diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c525e12a69d..d79b129c56a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,5 +1,6 @@ { "packages/gapic-node-templating": "0.0.0", + "packages/google-ai-generativelanguage": "1.0.1", "packages/google-analytics-admin": "6.0.0", "packages/google-analytics-data": "4.0.1", "packages/google-api-apikeys": "1.0.1", @@ -9,9 +10,12 @@ "packages/google-appengine": "3.0.1", "packages/google-area120-tables": "3.0.1", "packages/google-cloud-accessapproval": "3.0.1", + "packages/google-cloud-advisorynotifications": "1.0.1", "packages/google-cloud-aiplatform": "3.2.0", + "packages/google-cloud-alloydb": "1.0.1", "packages/google-cloud-apigateway": "3.0.1", "packages/google-cloud-apigeeconnect": "3.0.1", + "packages/google-cloud-apigeeregistry": "1.0.1", "packages/google-cloud-asset": "5.0.2", "packages/google-cloud-assuredworkloads": "4.0.1", "packages/google-cloud-baremetalsolution": "1.1.1", @@ -33,7 +37,10 @@ "packages/google-cloud-certificatemanager": "1.0.1", "packages/google-cloud-channel": "3.1.0", "packages/google-cloud-clouddms": "3.1.0", + "packages/google-cloud-commerce-consumer-procurement": "0.1.1", "packages/google-cloud-compute": "4.0.1", + "packages/google-cloud-confidentialcomputing": "1.1.0", + "packages/google-cloud-config": "0.1.0", "packages/google-cloud-contactcenterinsights": "3.0.1", "packages/google-cloud-contentwarehouse": "1.1.0", "packages/google-cloud-datacatalog": "4.0.1", @@ -65,13 +72,16 @@ "packages/google-cloud-ids": "3.0.1", "packages/google-cloud-iot": "4.0.1", "packages/google-cloud-kms": "4.0.1", + "packages/google-cloud-kms-inventory": "1.0.1", "packages/google-cloud-language": "6.1.0", "packages/google-cloud-lifesciences": "3.0.1", "packages/google-cloud-managedidentities": "3.0.1", "packages/google-cloud-mediatranslation": "4.0.1", "packages/google-cloud-memcache": "3.0.1", "packages/google-cloud-metastore": "4.0.1", + "packages/google-cloud-migrationcenter": "1.0.1", "packages/google-cloud-monitoring": "4.0.0", + "packages/google-cloud-netapp": "0.1.0", "packages/google-cloud-networkconnectivity": "3.0.1", "packages/google-cloud-networkmanagement": "3.1.0", "packages/google-cloud-networksecurity": "2.0.1", @@ -83,7 +93,9 @@ "packages/google-cloud-oslogin": "5.1.0", "packages/google-cloud-phishingprotection": "4.0.1", "packages/google-cloud-policytroubleshooter": "3.1.1", + "packages/google-cloud-policytroubleshooter-iam": "0.2.1", "packages/google-cloud-privatecatalog": "3.0.1", + "packages/google-cloud-rapidmigrationassessment": "1.0.1", "packages/google-cloud-recaptchaenterprise": "4.0.1", "packages/google-cloud-recommender": "6.1.0", "packages/google-cloud-redis": "4.0.1", @@ -99,6 +111,9 @@ "packages/google-cloud-servicedirectory": "5.0.1", "packages/google-cloud-shell": "3.0.1", "packages/google-cloud-speech": "6.0.2", + "packages/google-cloud-sql": "0.1.0", + "packages/google-cloud-storageinsights": "1.0.1", + "packages/google-cloud-support": "1.0.1", "packages/google-cloud-talent": "6.0.1", "packages/google-cloud-tasks": "4.0.1", "packages/google-cloud-texttospeech": "5.0.1", @@ -115,6 +130,7 @@ "packages/google-cloud-webrisk": "4.0.1", "packages/google-cloud-websecurityscanner": "3.0.1", "packages/google-cloud-workflows-executions": "3.1.0", + "packages/google-cloud-workstations": "1.1.0", "packages/google-container": "5.2.0", "packages/google-dataflow": "3.0.1", "packages/google-devtools-artifactregistry": "3.0.1", @@ -125,26 +141,11 @@ "packages/google-identity-accesscontextmanager": "3.0.1", "packages/google-maps-addressvalidation": "2.0.1", "packages/google-maps-mapsplatformdatasets": "1.0.1", + "packages/google-maps-places": "1.0.1", "packages/google-maps-routing": "1.0.1", "packages/google-monitoring-dashboard": "3.0.1", "packages/google-privacy-dlp": "5.0.1", "packages/google-storagetransfer": "3.0.1", "packages/grafeas": "5.0.1", - "packages/typeless-sample-bot": "2.0.0", - "packages/google-cloud-advisorynotifications": "1.0.1", - "packages/google-cloud-kms-inventory": "1.0.1", - "packages/google-cloud-alloydb": "1.0.1", - "packages/google-cloud-workstations": "1.1.0", - "packages/google-cloud-confidentialcomputing": "1.1.0", - "packages/google-ai-generativelanguage": "1.0.1", - "packages/google-cloud-storageinsights": "1.0.1", - "packages/google-maps-places": "1.0.1", - "packages/google-cloud-support": "1.0.1", - "packages/google-cloud-rapidmigrationassessment": "1.0.1", - "packages/google-cloud-migrationcenter": "1.0.1", - "packages/google-cloud-commerce-consumer-procurement": "0.1.1", - "packages/google-cloud-policytroubleshooter-iam": "0.2.1", - "packages/google-cloud-sql": "0.1.0", - "packages/google-cloud-config": "0.1.0", - "packages/google-cloud-netapp": "0.1.0" + "packages/typeless-sample-bot": "2.0.0" } diff --git a/packages/google-cloud-apigeeregistry/.OwlBot.yaml b/packages/google-cloud-apigeeregistry/.OwlBot.yaml new file mode 100644 index 00000000000..2fc15cc2a0b --- /dev/null +++ b/packages/google-cloud-apigeeregistry/.OwlBot.yaml @@ -0,0 +1,20 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/apigeeregistry/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-apigeeregistry/$1 diff --git a/packages/google-cloud-apigeeregistry/.eslintignore b/packages/google-cloud-apigeeregistry/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-apigeeregistry/.eslintrc.json b/packages/google-cloud-apigeeregistry/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-apigeeregistry/.gitattributes b/packages/google-cloud-apigeeregistry/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/.gitattributes @@ -0,0 +1,4 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated +**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/packages/google-cloud-apigeeregistry/.gitignore b/packages/google-cloud-apigeeregistry/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/packages/google-cloud-apigeeregistry/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/packages/google-cloud-apigeeregistry/.jsdoc.js b/packages/google-cloud-apigeeregistry/.jsdoc.js new file mode 100644 index 00000000000..671ff23ae00 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2023 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/apigee-registry', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-apigeeregistry/.mocharc.js b/packages/google-cloud-apigeeregistry/.mocharc.js new file mode 100644 index 00000000000..49e7e228701 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/google-cloud-apigeeregistry/.nycrc b/packages/google-cloud-apigeeregistry/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/.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-apigeeregistry/.prettierignore b/packages/google-cloud-apigeeregistry/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-apigeeregistry/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-apigeeregistry/.prettierrc.js b/packages/google-cloud-apigeeregistry/.prettierrc.js new file mode 100644 index 00000000000..1e6cec783e4 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-apigeeregistry/.repo-metadata.json b/packages/google-cloud-apigeeregistry/.repo-metadata.json new file mode 100644 index 00000000000..71e1696543b --- /dev/null +++ b/packages/google-cloud-apigeeregistry/.repo-metadata.json @@ -0,0 +1,14 @@ +{ + "name": "apigeeregistry", + "name_pretty": "Apigee Registry API", + "product_documentation": "https://cloud.google.com/apigee/docs/api-hub/get-started-registry-api", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/apigee-registry/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "beta", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/apigee-registry", + "api_id": "apigeeregistry.googleapis.com", + "default_version": "v1", + "requires_billing": true +} diff --git a/packages/google-cloud-apigeeregistry/CHANGELOG.md b/packages/google-cloud-apigeeregistry/CHANGELOG.md new file mode 100644 index 00000000000..7d6ef629a77 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/CHANGELOG.md @@ -0,0 +1,63 @@ +# Changelog + +## [1.0.1](https://github.com/googleapis/nodejs-apigee-registry/compare/v1.0.0...v1.0.1) (2023-09-07) + + +### Bug Fixes + +* Simplify logic for HTTP/1.1 REST fallback option ([#54](https://github.com/googleapis/nodejs-apigee-registry/issues/54)) ([c873226](https://github.com/googleapis/nodejs-apigee-registry/commit/c87322645e01d1e1cf989aa5f8502876d7b77230)) + +## [1.0.0](https://github.com/googleapis/nodejs-apigee-registry/compare/v0.3.0...v1.0.0) (2023-08-15) + + +### ⚠ BREAKING CHANGES + +* update to Node 14 ([#50](https://github.com/googleapis/nodejs-apigee-registry/issues/50)) + +### Miscellaneous Chores + +* Update to Node 14 ([#50](https://github.com/googleapis/nodejs-apigee-registry/issues/50)) ([ae2c7ea](https://github.com/googleapis/nodejs-apigee-registry/commit/ae2c7ea278d037c3ba020192ab8913b0659191e8)) + +## [0.3.0](https://github.com/googleapis/nodejs-apigee-registry/compare/v0.2.1...v0.3.0) (2023-02-09) + + +### Features + +* Added SuggestConversationSummary RPC ([8110940](https://github.com/googleapis/nodejs-apigee-registry/commit/8110940e67c72bd94776c17863fa52d714b270ae)) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#25](https://github.com/googleapis/nodejs-apigee-registry/issues/25)) ([1ee9a1d](https://github.com/googleapis/nodejs-apigee-registry/commit/1ee9a1d07a6cd4930c07651a0e17bb41c0663777)) + +## [0.2.1](https://github.com/googleapis/nodejs-apigee-registry/compare/v0.2.0...v0.2.1) (2022-09-21) + + +### Bug Fixes + +* Additional error codes added to service configuration for retry ([#16](https://github.com/googleapis/nodejs-apigee-registry/issues/16)) ([4be826d](https://github.com/googleapis/nodejs-apigee-registry/commit/4be826ddc63cd21391a7c204fc361156c5c0b673)) +* Preserve default values in x-goog-request-params header ([#18](https://github.com/googleapis/nodejs-apigee-registry/issues/18)) ([19c2bf9](https://github.com/googleapis/nodejs-apigee-registry/commit/19c2bf9e6bc00d99fd3b07c9c71ca946ece94695)) + +## [0.2.0](https://github.com/googleapis/nodejs-apigee-registry/compare/v0.1.0...v0.2.0) (2022-08-30) + + +### Features + +* added support for force field for API and API version deletion ([c0bf481](https://github.com/googleapis/nodejs-apigee-registry/commit/c0bf48111db1e05f88cb68fac40584e60bbdf6f6)) + + +### Bug Fixes + +* change import long to require ([#12](https://github.com/googleapis/nodejs-apigee-registry/issues/12)) ([c04237e](https://github.com/googleapis/nodejs-apigee-registry/commit/c04237ebc9dc76016f9017ee6f8cdf938fd14da8)) +* do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-apigee-registry/issues/1553)) ([#15](https://github.com/googleapis/nodejs-apigee-registry/issues/15)) ([34da6db](https://github.com/googleapis/nodejs-apigee-registry/commit/34da6dbc51476bf7a30fae332233c76527f9e9ff)) +* remove pip install statements ([#1546](https://github.com/googleapis/nodejs-apigee-registry/issues/1546)) ([#14](https://github.com/googleapis/nodejs-apigee-registry/issues/14)) ([a6dba15](https://github.com/googleapis/nodejs-apigee-registry/commit/a6dba15c574a7537771ee95a50785b30b83eb4a2)) +* use google-gax v3.3.0 ([34da6db](https://github.com/googleapis/nodejs-apigee-registry/commit/34da6dbc51476bf7a30fae332233c76527f9e9ff)) + +## 0.1.0 (2022-07-21) + + +### Features + +* add initial samples and tests ([77257a4](https://github.com/googleapis/nodejs-apigee-registry/commit/77257a467f559529416327d362ba46aaef41b037)) +* add templated files from docker image ([4999fc5](https://github.com/googleapis/nodejs-apigee-registry/commit/4999fc5f4b8150c2b2d3bcdb15d17c6ac400bfb2)) +* initial stub of library ([81efd1e](https://github.com/googleapis/nodejs-apigee-registry/commit/81efd1e2ac2c301b1a95fca58b83c9ab61103f19)) diff --git a/packages/google-cloud-apigeeregistry/CODE_OF_CONDUCT.md b/packages/google-cloud-apigeeregistry/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/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-apigeeregistry/CONTRIBUTING.md b/packages/google-cloud-apigeeregistry/CONTRIBUTING.md new file mode 100644 index 00000000000..0a19fb4c70f --- /dev/null +++ b/packages/google-cloud-apigeeregistry/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 Apigee Registry 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=apigeeregistry.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-apigeeregistry/LICENSE b/packages/google-cloud-apigeeregistry/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/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-apigeeregistry/README.md b/packages/google-cloud-apigeeregistry/README.md new file mode 100644 index 00000000000..0a9caf86a87 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/README.md @@ -0,0 +1,173 @@ +[//]: # "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 + +# [Apigee Registry API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-apigeeregistry) + +[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/apigee-registry.svg)](https://www.npmjs.org/package/@google-cloud/apigee-registry) + + + + +apigeeregistry 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-apigeeregistry/CHANGELOG.md). + +* [Apigee Registry API Node.js Client API Reference][client-docs] +* [Apigee Registry API Documentation][product-docs] +* [github.com/googleapis/google-cloud-node/packages/google-cloud-apigeeregistry](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-apigeeregistry) + +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) + +* [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 Apigee Registry 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/apigee-registry +``` + + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-apigeeregistry/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Provisioning.create_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.create_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-apigeeregistry/samples/generated/v1/provisioning.create_instance.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Provisioning.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.delete_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-apigeeregistry/samples/generated/v1/provisioning.delete_instance.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Provisioning.get_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.get_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-apigeeregistry/samples/generated/v1/provisioning.get_instance.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.create_api | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.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-apigeeregistry/samples/generated/v1/registry.create_api.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.create_api_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_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-apigeeregistry/samples/generated/v1/registry.create_api_deployment.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.create_api_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_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-apigeeregistry/samples/generated/v1/registry.create_api_spec.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.create_api_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_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-apigeeregistry/samples/generated/v1/registry.create_api_version.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.create_artifact | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_artifact.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-apigeeregistry/samples/generated/v1/registry.create_artifact.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.delete_api | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.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-apigeeregistry/samples/generated/v1/registry.delete_api.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.delete_api_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_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-apigeeregistry/samples/generated/v1/registry.delete_api_deployment.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.delete_api_deployment_revision | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment_revision.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-apigeeregistry/samples/generated/v1/registry.delete_api_deployment_revision.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.delete_api_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_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-apigeeregistry/samples/generated/v1/registry.delete_api_spec.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.delete_api_spec_revision | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec_revision.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-apigeeregistry/samples/generated/v1/registry.delete_api_spec_revision.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.delete_api_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_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-apigeeregistry/samples/generated/v1/registry.delete_api_version.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.delete_artifact | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_artifact.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-apigeeregistry/samples/generated/v1/registry.delete_artifact.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.get_api | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.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-apigeeregistry/samples/generated/v1/registry.get_api.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.get_api_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_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-apigeeregistry/samples/generated/v1/registry.get_api_deployment.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.get_api_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_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-apigeeregistry/samples/generated/v1/registry.get_api_spec.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.get_api_spec_contents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_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-apigeeregistry/samples/generated/v1/registry.get_api_spec_contents.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.get_api_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_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-apigeeregistry/samples/generated/v1/registry.get_api_version.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.get_artifact | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact.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-apigeeregistry/samples/generated/v1/registry.get_artifact.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.get_artifact_contents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact_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-apigeeregistry/samples/generated/v1/registry.get_artifact_contents.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.list_api_deployment_revisions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployment_revisions.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-apigeeregistry/samples/generated/v1/registry.list_api_deployment_revisions.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.list_api_deployments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_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-apigeeregistry/samples/generated/v1/registry.list_api_deployments.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.list_api_spec_revisions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_spec_revisions.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-apigeeregistry/samples/generated/v1/registry.list_api_spec_revisions.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.list_api_specs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_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-apigeeregistry/samples/generated/v1/registry.list_api_specs.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.list_api_versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_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-apigeeregistry/samples/generated/v1/registry.list_api_versions.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.list_apis | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.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-apigeeregistry/samples/generated/v1/registry.list_apis.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.list_artifacts | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_artifacts.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-apigeeregistry/samples/generated/v1/registry.list_artifacts.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.replace_artifact | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.replace_artifact.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-apigeeregistry/samples/generated/v1/registry.replace_artifact.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.rollback_api_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_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-apigeeregistry/samples/generated/v1/registry.rollback_api_deployment.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.rollback_api_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_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-apigeeregistry/samples/generated/v1/registry.rollback_api_spec.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.tag_api_deployment_revision | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_deployment_revision.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-apigeeregistry/samples/generated/v1/registry.tag_api_deployment_revision.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.tag_api_spec_revision | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_spec_revision.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-apigeeregistry/samples/generated/v1/registry.tag_api_spec_revision.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.update_api | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.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-apigeeregistry/samples/generated/v1/registry.update_api.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.update_api_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_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-apigeeregistry/samples/generated/v1/registry.update_api_deployment.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.update_api_spec | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_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-apigeeregistry/samples/generated/v1/registry.update_api_spec.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Registry.update_api_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_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-apigeeregistry/samples/generated/v1/registry.update_api_version.js,packages/google-cloud-apigeeregistry/samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/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-apigeeregistry/samples/quickstart.js,packages/google-cloud-apigeeregistry/samples/README.md) | + + + +The [Apigee Registry 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/apigee-registry@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 **beta**. This means it is expected to be +mostly stable while we work toward a general availability release; however, +complete stability is not guaranteed. We will address issues and requests +against beta libraries with a high priority. + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/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/apigee-registry/latest +[product-docs]: https://cloud.google.com/apigee/docs/api-hub/get-started-registry-api +[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=apigeeregistry.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-apigeeregistry/linkinator.config.json b/packages/google-cloud-apigeeregistry/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/packages/google-cloud-apigeeregistry/package.json b/packages/google-cloud-apigeeregistry/package.json new file mode 100644 index 00000000000..784f801f898 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/package.json @@ -0,0 +1,73 @@ +{ + "name": "@google-cloud/apigee-registry", + "version": "1.0.1", + "description": "apigeeregistry client for Node.js", + "repository": { + "type": "git", + "directory": "packages/google-cloud-apigeeregistry", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, + "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 apigeeregistry", + "apigeeregistry", + "apigeeregistry service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "npm run compile && c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^4.0.3" + }, + "devDependencies": { + "@types/mocha": "^10.0.0", + "@types/node": "^20.4.9", + "@types/sinon": "^10.0.0", + "c8": "^8.0.1", + "gapic-tools": "^0.1.8", + "gts": "^5.0.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "linkinator": "4.1.2", + "long": "^5.2.3", + "mocha": "^10.0.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^15.0.0", + "ts-loader": "^9.1.2", + "typescript": "^5.1.6", + "webpack": "^5.36.2", + "webpack-cli": "^5.0.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-apigeeregistry" +} diff --git a/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/provisioning_service.proto b/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/provisioning_service.proto new file mode 100644 index 00000000000..cca6753c6bc --- /dev/null +++ b/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/provisioning_service.proto @@ -0,0 +1,205 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.apigeeregistry.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ApigeeRegistry.V1"; +option go_package = "cloud.google.com/go/apigeeregistry/apiv1/apigeeregistrypb;apigeeregistrypb"; +option java_multiple_files = true; +option java_outer_classname = "ProvisioningServiceProto"; +option java_package = "com.google.cloud.apigeeregistry.v1"; +option php_namespace = "Google\\Cloud\\ApigeeRegistry\\V1"; +option ruby_package = "Google::Cloud::ApigeeRegistry::V1"; + +// The service that is used for managing the data plane provisioning of the +// Registry. +service Provisioning { + option (google.api.default_host) = "apigeeregistry.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Provisions instance resources for the Registry. + rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/instances" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Deletes the Registry instance. + rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Gets details of a single Instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request message for CreateInstance. +message CreateInstanceRequest { + // Required. Parent resource of the Instance, of the form: `projects/*/locations/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. Identifier to assign to the Instance. Must be unique within scope of the + // parent resource. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Instance. + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DeleteInstance. +message DeleteInstanceRequest { + // Required. The name of the Instance to delete. + // Format: `projects/*/locations/*/instances/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/Instance" + } + ]; +} + +// Request message for GetInstance. +message GetInstanceRequest { + // Required. The name of the Instance to retrieve. + // Format: `projects/*/locations/*/instances/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/Instance" + } + ]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // The time the operation was created. + google.protobuf.Timestamp create_time = 1; + + // The time the operation finished running. + google.protobuf.Timestamp end_time = 2; + + // Server-defined resource path for the target of the operation. + string target = 3; + + // Name of the verb executed by the operation. + string verb = 4; + + // Human-readable status of the operation, if any. + string status_message = 5; + + // Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool cancellation_requested = 6; + + // API version used to start the operation. + string api_version = 7; +} + +// An Instance represents the instance resources of the Registry. +// Currently, only one instance is allowed for each project. +message Instance { + option (google.api.resource) = { + type: "apigeeregistry.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/instances/{instance}" + }; + + // State of the Instance. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // The Instance has not been initialized or has been deleted. + INACTIVE = 1; + + // The Instance is being created. + CREATING = 2; + + // The Instance has been created and is ready for use. + ACTIVE = 3; + + // The Instance is being updated. + UPDATING = 4; + + // The Instance is being deleted. + DELETING = 5; + + // The Instance encountered an error during a state change. + FAILED = 6; + } + + // Available configurations to provision an Instance. + message Config { + // Output only. The GCP location where the Instance resides. + string location = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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 InstanceConfig.location. + string cmek_key_name = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Format: `projects/*/locations/*/instance`. + // Currently only `locations/global` is supported. + string name = 1; + + // 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 Instance. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Extra information of Instance.State if the state is `FAILED`. + string state_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Config of the Instance. + Config config = 6 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/registry_models.proto b/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/registry_models.proto new file mode 100644 index 00000000000..a1c29b4d5b9 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/registry_models.proto @@ -0,0 +1,364 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.apigeeregistry.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.ApigeeRegistry.V1"; +option go_package = "cloud.google.com/go/apigeeregistry/apiv1/apigeeregistrypb;apigeeregistrypb"; +option java_multiple_files = true; +option java_outer_classname = "RegistryModelsProto"; +option java_package = "com.google.cloud.apigeeregistry.v1"; +option php_namespace = "Google\\Cloud\\ApigeeRegistry\\V1"; +option ruby_package = "Google::Cloud::ApigeeRegistry::V1"; + +// A top-level description of an API. +// Produced by producers and are commitments to provide services. +message Api { + option (google.api.resource) = { + type: "apigeeregistry.googleapis.com/Api" + pattern: "projects/{project}/locations/{location}/apis/{api}" + }; + + // Resource name. + string name = 1; + + // Human-meaningful name. + string display_name = 2; + + // A detailed description. + string description = 3; + + // Output only. Creation timestamp. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update timestamp. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A user-definable description of the availability of this service. + // Format: free-form, but we expect single words that describe availability, + // e.g., "NONE", "TESTING", "PREVIEW", "GENERAL", "DEPRECATED", "SHUTDOWN". + string availability = 6; + + // The recommended version of the API. + // Format: `apis/{api}/versions/{version}` + string recommended_version = 7 [(google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiVersion" + }]; + + // The recommended deployment of the API. + // Format: `apis/{api}/deployments/{deployment}` + string recommended_deployment = 8 [(google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiDeployment" + }]; + + // Labels attach identifying metadata to resources. Identifying metadata can + // be used to filter list operations. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores, and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one resource (System + // labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with + // `apigeeregistry.googleapis.com/` and cannot be changed. + map labels = 9; + + // Annotations attach non-identifying metadata to resources. + // + // Annotation keys and values are less restricted than those of labels, but + // should be generally used for small values of broad interest. Larger, topic- + // specific metadata should be stored in Artifacts. + map annotations = 10; +} + +// Describes a particular version of an API. +// ApiVersions are what consumers actually use. +message ApiVersion { + option (google.api.resource) = { + type: "apigeeregistry.googleapis.com/ApiVersion" + pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}" + }; + + // Resource name. + string name = 1; + + // Human-meaningful name. + string display_name = 2; + + // A detailed description. + string description = 3; + + // Output only. Creation timestamp. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update timestamp. + google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A user-definable description of the lifecycle phase of this API version. + // Format: free-form, but we expect single words that describe API maturity, + // e.g., "CONCEPT", "DESIGN", "DEVELOPMENT", "STAGING", "PRODUCTION", + // "DEPRECATED", "RETIRED". + string state = 6; + + // Labels attach identifying metadata to resources. Identifying metadata can + // be used to filter list operations. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one resource (System + // labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with + // `apigeeregistry.googleapis.com/` and cannot be changed. + map labels = 7; + + // Annotations attach non-identifying metadata to resources. + // + // Annotation keys and values are less restricted than those of labels, but + // should be generally used for small values of broad interest. Larger, topic- + // specific metadata should be stored in Artifacts. + map annotations = 8; +} + +// Describes a version of an API in a structured way. +// ApiSpecs provide formal descriptions that consumers can use to use a version. +// ApiSpec resources are intended to be fully-resolved descriptions of an +// ApiVersion. When specs consist of multiple files, these should be bundled +// together (e.g., in a zip archive) and stored as a unit. Multiple specs can +// exist to provide representations in different API description formats. +// Synchronization of these representations would be provided by tooling and +// background services. +message ApiSpec { + option (google.api.resource) = { + type: "apigeeregistry.googleapis.com/ApiSpec" + pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}" + }; + + // Resource name. + string name = 1; + + // A possibly-hierarchical name used to refer to the spec from other specs. + string filename = 2; + + // A detailed description. + string description = 3; + + // Output only. Immutable. The revision ID of the spec. + // A new revision is committed whenever the spec contents are changed. + // The format is an 8-character hexadecimal string. + string revision_id = 4 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. Creation timestamp; when the spec resource was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Revision creation timestamp; when the represented revision was created. + google.protobuf.Timestamp revision_create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update timestamp: when the represented revision was last modified. + google.protobuf.Timestamp revision_update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A style (format) descriptor for this spec that is specified as a Media Type + // (https://en.wikipedia.org/wiki/Media_type). Possible values include + // `application/vnd.apigee.proto`, `application/vnd.apigee.openapi`, and + // `application/vnd.apigee.graphql`, with possible suffixes representing + // compression types. These hypothetical names are defined in the vendor tree + // defined in RFC6838 (https://tools.ietf.org/html/rfc6838) and are not final. + // Content types can specify compression. Currently only GZip compression is + // supported (indicated with "+gzip"). + string mime_type = 8; + + // Output only. The size of the spec file in bytes. If the spec is gzipped, this is the + // size of the uncompressed spec. + int32 size_bytes = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A SHA-256 hash of the spec's contents. If the spec is gzipped, this is + // the hash of the uncompressed spec. + string hash = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The original source URI of the spec (if one exists). + // This is an external location that can be used for reference purposes + // but which may not be authoritative since this external resource may + // change after the spec is retrieved. + string source_uri = 11; + + // Input only. The contents of the spec. + // Provided by API callers when specs are created or updated. + // To access the contents of a spec, use GetApiSpecContents. + bytes contents = 12 [(google.api.field_behavior) = INPUT_ONLY]; + + // Labels attach identifying metadata to resources. Identifying metadata can + // be used to filter list operations. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one resource (System + // labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with + // `apigeeregistry.googleapis.com/` and cannot be changed. + map labels = 14; + + // Annotations attach non-identifying metadata to resources. + // + // Annotation keys and values are less restricted than those of labels, but + // should be generally used for small values of broad interest. Larger, topic- + // specific metadata should be stored in Artifacts. + map annotations = 15; +} + +// Describes a service running at particular address that +// provides a particular version of an API. ApiDeployments have revisions which +// correspond to different configurations of a single deployment in time. +// Revision identifiers should be updated whenever the served API spec or +// endpoint address changes. +message ApiDeployment { + option (google.api.resource) = { + type: "apigeeregistry.googleapis.com/ApiDeployment" + pattern: "projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}" + }; + + // Resource name. + string name = 1; + + // Human-meaningful name. + string display_name = 2; + + // A detailed description. + string description = 3; + + // Output only. Immutable. The revision ID of the deployment. + // A new revision is committed whenever the deployment contents are changed. + // The format is an 8-character hexadecimal string. + string revision_id = 4 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. Creation timestamp; when the deployment resource was created. + google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Revision creation timestamp; when the represented revision was created. + google.protobuf.Timestamp revision_create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update timestamp: when the represented revision was last modified. + google.protobuf.Timestamp revision_update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The full resource name (including revision ID) of the spec of the API being + // served by the deployment. Changes to this value will update the revision. + // Format: `apis/{api}/deployments/{deployment}` + string api_spec_revision = 8 [(google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiSpec" + }]; + + // The address where the deployment is serving. Changes to this value will + // update the revision. + string endpoint_uri = 9; + + // The address of the external channel of the API (e.g., the Developer + // Portal). Changes to this value will not affect the revision. + string external_channel_uri = 10; + + // Text briefly identifying the intended audience of the API. Changes to this + // value will not affect the revision. + string intended_audience = 11; + + // Text briefly describing how to access the endpoint. Changes to this value + // will not affect the revision. + string access_guidance = 12; + + // Labels attach identifying metadata to resources. Identifying metadata can + // be used to filter list operations. + // + // Label keys and values can be no longer than 64 characters + // (Unicode codepoints), can only contain lowercase letters, numeric + // characters, underscores and dashes. International characters are allowed. + // No more than 64 user labels can be associated with one resource (System + // labels are excluded). + // + // See https://goo.gl/xmQnxf for more information and examples of labels. + // System reserved label keys are prefixed with + // `apigeeregistry.googleapis.com/` and cannot be changed. + map labels = 14; + + // Annotations attach non-identifying metadata to resources. + // + // Annotation keys and values are less restricted than those of labels, but + // should be generally used for small values of broad interest. Larger, topic- + // specific metadata should be stored in Artifacts. + map annotations = 15; +} + +// Artifacts of resources. Artifacts are unique (single-value) per resource +// and are used to store metadata that is too large or numerous to be stored +// directly on the resource. Since artifacts are stored separately from parent +// resources, they should generally be used for metadata that is needed +// infrequently, i.e., not for display in primary views of the resource but +// perhaps displayed or downloaded upon request. The `ListArtifacts` method +// allows artifacts to be quickly enumerated and checked for presence without +// downloading their (potentially-large) contents. +message Artifact { + option (google.api.resource) = { + type: "apigeeregistry.googleapis.com/Artifact" + pattern: "projects/{project}/locations/{location}/artifacts/{artifact}" + pattern: "projects/{project}/locations/{location}/apis/{api}/artifacts/{artifact}" + pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/artifacts/{artifact}" + pattern: "projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}/artifacts/{artifact}" + pattern: "projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}/artifacts/{artifact}" + }; + + // Resource name. + string name = 1; + + // 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]; + + // A content type specifier for the artifact. + // Content type specifiers are Media Types + // (https://en.wikipedia.org/wiki/Media_type) with a possible "schema" + // parameter that specifies a schema for the stored information. + // Content types can specify compression. Currently only GZip compression is + // supported (indicated with "+gzip"). + string mime_type = 4; + + // Output only. The size of the artifact in bytes. If the artifact is gzipped, this is + // the size of the uncompressed artifact. + int32 size_bytes = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A SHA-256 hash of the artifact's contents. If the artifact is gzipped, + // this is the hash of the uncompressed artifact. + string hash = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Input only. The contents of the artifact. + // Provided by API callers when artifacts are created or replaced. + // To access the contents of an artifact, use GetArtifactContents. + bytes contents = 7 [(google.api.field_behavior) = INPUT_ONLY]; +} diff --git a/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/registry_service.proto b/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/registry_service.proto new file mode 100644 index 00000000000..041796be41f --- /dev/null +++ b/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/registry_service.proto @@ -0,0 +1,1133 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.apigeeregistry.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/httpbody.proto"; +import "google/api/resource.proto"; +import "google/cloud/apigeeregistry/v1/registry_models.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.ApigeeRegistry.V1"; +option go_package = "cloud.google.com/go/apigeeregistry/apiv1/apigeeregistrypb;apigeeregistrypb"; +option java_multiple_files = true; +option java_outer_classname = "RegistryServiceProto"; +option java_package = "com.google.cloud.apigeeregistry.v1"; +option php_namespace = "Google\\Cloud\\ApigeeRegistry\\V1"; +option ruby_package = "Google::Cloud::ApigeeRegistry::V1"; + +// The Registry service allows teams to manage descriptions of APIs. +service Registry { + option (google.api.default_host) = "apigeeregistry.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Returns matching APIs. + rpc ListApis(ListApisRequest) returns (ListApisResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/apis" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns a specified API. + rpc GetApi(GetApiRequest) returns (Api) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a specified API. + 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"; + } + + // Used to modify a specified API. + 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"; + } + + // Removes a specified API and all of the resources that it + // owns. + rpc DeleteApi(DeleteApiRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apis/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns matching versions. + rpc ListApiVersions(ListApiVersionsRequest) returns (ListApiVersionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apis/*}/versions" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns a specified version. + rpc GetApiVersion(GetApiVersionRequest) returns (ApiVersion) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a specified version. + rpc CreateApiVersion(CreateApiVersionRequest) returns (ApiVersion) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/apis/*}/versions" + body: "api_version" + }; + option (google.api.method_signature) = "parent,api_version,api_version_id"; + } + + // Used to modify a specified version. + rpc UpdateApiVersion(UpdateApiVersionRequest) returns (ApiVersion) { + option (google.api.http) = { + patch: "/v1/{api_version.name=projects/*/locations/*/apis/*/versions/*}" + body: "api_version" + }; + option (google.api.method_signature) = "api_version,update_mask"; + } + + // Removes a specified version and all of the resources that + // it owns. + rpc DeleteApiVersion(DeleteApiVersionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns matching specs. + rpc ListApiSpecs(ListApiSpecsRequest) returns (ListApiSpecsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns a specified spec. + rpc GetApiSpec(GetApiSpecRequest) returns (ApiSpec) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns the contents of a specified spec. + // If specs are stored with GZip compression, the default behavior + // is to return the spec uncompressed (the mime_type response field + // indicates the exact format returned). + rpc GetApiSpecContents(GetApiSpecContentsRequest) returns (google.api.HttpBody) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:getContents" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a specified spec. + rpc CreateApiSpec(CreateApiSpecRequest) returns (ApiSpec) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs" + body: "api_spec" + }; + option (google.api.method_signature) = "parent,api_spec,api_spec_id"; + } + + // Used to modify a specified spec. + rpc UpdateApiSpec(UpdateApiSpecRequest) returns (ApiSpec) { + option (google.api.http) = { + patch: "/v1/{api_spec.name=projects/*/locations/*/apis/*/versions/*/specs/*}" + body: "api_spec" + }; + option (google.api.method_signature) = "api_spec,update_mask"; + } + + // Removes a specified spec, all revisions, and all child + // resources (e.g., artifacts). + rpc DeleteApiSpec(DeleteApiSpecRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Adds a tag to a specified revision of a spec. + rpc TagApiSpecRevision(TagApiSpecRevisionRequest) returns (ApiSpec) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:tagRevision" + body: "*" + }; + } + + // Lists all revisions of a spec. + // Revisions are returned in descending order of revision creation time. + rpc ListApiSpecRevisions(ListApiSpecRevisionsRequest) returns (ListApiSpecRevisionsResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:listRevisions" + }; + } + + // Sets the current revision to a specified prior revision. + // Note that this creates a new revision with a new revision ID. + rpc RollbackApiSpec(RollbackApiSpecRequest) returns (ApiSpec) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:rollback" + body: "*" + }; + } + + // Deletes a revision of a spec. + rpc DeleteApiSpecRevision(DeleteApiSpecRevisionRequest) returns (ApiSpec) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:deleteRevision" + }; + option (google.api.method_signature) = "name"; + } + + // Returns matching deployments. + rpc ListApiDeployments(ListApiDeploymentsRequest) returns (ListApiDeploymentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/apis/*}/deployments" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns a specified deployment. + rpc GetApiDeployment(GetApiDeploymentRequest) returns (ApiDeployment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/deployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a specified deployment. + rpc CreateApiDeployment(CreateApiDeploymentRequest) returns (ApiDeployment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/apis/*}/deployments" + body: "api_deployment" + }; + option (google.api.method_signature) = "parent,api_deployment,api_deployment_id"; + } + + // Used to modify a specified deployment. + rpc UpdateApiDeployment(UpdateApiDeploymentRequest) returns (ApiDeployment) { + option (google.api.http) = { + patch: "/v1/{api_deployment.name=projects/*/locations/*/apis/*/deployments/*}" + body: "api_deployment" + }; + option (google.api.method_signature) = "api_deployment,update_mask"; + } + + // Removes a specified deployment, all revisions, and all + // child resources (e.g., artifacts). + rpc DeleteApiDeployment(DeleteApiDeploymentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apis/*/deployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Adds a tag to a specified revision of a + // deployment. + rpc TagApiDeploymentRevision(TagApiDeploymentRevisionRequest) returns (ApiDeployment) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:tagRevision" + body: "*" + }; + } + + // Lists all revisions of a deployment. + // Revisions are returned in descending order of revision creation time. + rpc ListApiDeploymentRevisions(ListApiDeploymentRevisionsRequest) returns (ListApiDeploymentRevisionsResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:listRevisions" + }; + } + + // Sets the current revision to a specified prior + // revision. Note that this creates a new revision with a new revision ID. + rpc RollbackApiDeployment(RollbackApiDeploymentRequest) returns (ApiDeployment) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:rollback" + body: "*" + }; + } + + // Deletes a revision of a deployment. + rpc DeleteApiDeploymentRevision(DeleteApiDeploymentRevisionRequest) returns (ApiDeployment) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:deleteRevision" + }; + option (google.api.method_signature) = "name"; + } + + // Returns matching artifacts. + rpc ListArtifacts(ListArtifactsRequest) returns (ListArtifactsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/artifacts" + additional_bindings { + get: "/v1/{parent=projects/*/locations/*/apis/*}/artifacts" + } + additional_bindings { + get: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/artifacts" + } + additional_bindings { + get: "/v1/{parent=projects/*/locations/*/apis/*/versions/*/specs/*}/artifacts" + } + additional_bindings { + get: "/v1/{parent=projects/*/locations/*/apis/*/deployments/*}/artifacts" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Returns a specified artifact. + rpc GetArtifact(GetArtifactRequest) returns (Artifact) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/artifacts/*}" + additional_bindings { + get: "/v1/{name=projects/*/locations/*/apis/*/artifacts/*}" + } + additional_bindings { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/artifacts/*}" + } + additional_bindings { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}" + } + additional_bindings { + get: "/v1/{name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Returns the contents of a specified artifact. + // If artifacts are stored with GZip compression, the default behavior + // is to return the artifact uncompressed (the mime_type response field + // indicates the exact format returned). + rpc GetArtifactContents(GetArtifactContentsRequest) returns (google.api.HttpBody) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/artifacts/*}:getContents" + additional_bindings { + get: "/v1/{name=projects/*/locations/*/apis/*/artifacts/*}:getContents" + } + additional_bindings { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/artifacts/*}:getContents" + } + additional_bindings { + get: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}:getContents" + } + additional_bindings { + get: "/v1/{name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}:getContents" + } + }; + option (google.api.method_signature) = "name"; + } + + // Creates a specified artifact. + rpc CreateArtifact(CreateArtifactRequest) returns (Artifact) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/artifacts" + body: "artifact" + additional_bindings { + post: "/v1/{parent=projects/*/locations/*/apis/*}/artifacts" + body: "artifact" + } + additional_bindings { + post: "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/artifacts" + body: "artifact" + } + additional_bindings { + post: "/v1/{parent=projects/*/locations/*/apis/*/versions/*/specs/*}/artifacts" + body: "artifact" + } + additional_bindings { + post: "/v1/{parent=projects/*/locations/*/apis/*/deployments/*}/artifacts" + body: "artifact" + } + }; + option (google.api.method_signature) = "parent,artifact,artifact_id"; + } + + // Used to replace a specified artifact. + rpc ReplaceArtifact(ReplaceArtifactRequest) returns (Artifact) { + option (google.api.http) = { + put: "/v1/{artifact.name=projects/*/locations/*/artifacts/*}" + body: "artifact" + additional_bindings { + put: "/v1/{artifact.name=projects/*/locations/*/apis/*/artifacts/*}" + body: "artifact" + } + additional_bindings { + put: "/v1/{artifact.name=projects/*/locations/*/apis/*/versions/*/artifacts/*}" + body: "artifact" + } + additional_bindings { + put: "/v1/{artifact.name=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}" + body: "artifact" + } + additional_bindings { + put: "/v1/{artifact.name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}" + body: "artifact" + } + }; + option (google.api.method_signature) = "artifact"; + } + + // Removes a specified artifact. + rpc DeleteArtifact(DeleteArtifactRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/artifacts/*}" + additional_bindings { + delete: "/v1/{name=projects/*/locations/*/apis/*/artifacts/*}" + } + additional_bindings { + delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*/artifacts/*}" + } + additional_bindings { + delete: "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}" + } + additional_bindings { + delete: "/v1/{name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}" + } + }; + option (google.api.method_signature) = "name"; + } +} + +// Request message for ListApis. +message ListApisRequest { + // Required. The parent, which owns this collection of APIs. + // Format: `projects/*/locations/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apigeeregistry.googleapis.com/Api" + } + ]; + + // The maximum number of APIs to return. + // The service may return fewer than this value. + // If unspecified, at most 50 values will be returned. + // The maximum is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListApis` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListApis` must match + // the call that provided the page token. + string page_token = 3; + + // An expression that can be used to filter the list. Filters use the Common + // Expression Language and can refer to all message fields. + string filter = 4; +} + +// Response message for ListApis. +message ListApisResponse { + // The APIs from the specified publisher. + 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; +} + +// Request message for GetApi. +message GetApiRequest { + // Required. The name of the API to retrieve. + // Format: `projects/*/locations/*/apis/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/Api" + } + ]; +} + +// Request message for CreateApi. +message CreateApiRequest { + // Required. The parent, which owns this collection of APIs. + // Format: `projects/*/locations/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apigeeregistry.googleapis.com/Api" + } + ]; + + // Required. The API to create. + Api api = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the API, which will become the final component of + // the API's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + // + // Following AIP-162, IDs must not have the form of a UUID. + string api_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for UpdateApi. +message UpdateApiRequest { + // Required. The API to update. + // + // The `name` field is used to identify the API to update. + // Format: `projects/*/locations/*/apis/*` + Api api = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. If omitted, all fields are updated that + // are set in the request message (fields set to default values are ignored). + // If an asterisk "*" is specified, all fields are updated, including fields + // that are unspecified/default in the request. + google.protobuf.FieldMask update_mask = 2; + + // If set to true, and the API is not found, a new API will be created. + // In this situation, `update_mask` is ignored. + bool allow_missing = 3; +} + +// Request message for DeleteApi. +message DeleteApiRequest { + // Required. The name of the API to delete. + // Format: `projects/*/locations/*/apis/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/Api" + } + ]; + + // If set to true, any child resources will also be deleted. + // (Otherwise, the request will only work if there are no child resources.) + bool force = 2; +} + +// Request message for ListApiVersions. +message ListApiVersionsRequest { + // Required. The parent, which owns this collection of versions. + // Format: `projects/*/locations/*/apis/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apigeeregistry.googleapis.com/ApiVersion" + } + ]; + + // The maximum number of versions to return. + // The service may return fewer than this value. + // If unspecified, at most 50 values will be returned. + // The maximum is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListApiVersions` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListApiVersions` must + // match the call that provided the page token. + string page_token = 3; + + // An expression that can be used to filter the list. Filters use the Common + // Expression Language and can refer to all message fields. + string filter = 4; +} + +// Response message for ListApiVersions. +message ListApiVersionsResponse { + // The versions from the specified publisher. + repeated ApiVersion api_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; +} + +// Request message for GetApiVersion. +message GetApiVersionRequest { + // Required. The name of the version to retrieve. + // Format: `projects/*/locations/*/apis/*/versions/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiVersion" + } + ]; +} + +// Request message for CreateApiVersion. +message CreateApiVersionRequest { + // Required. The parent, which owns this collection of versions. + // Format: `projects/*/locations/*/apis/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apigeeregistry.googleapis.com/ApiVersion" + } + ]; + + // Required. The version to create. + ApiVersion api_version = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the version, which will become the final component of + // the version's resource name. + // + // This value should be 1-63 characters, and valid characters + // are /[a-z][0-9]-/. + // + // Following AIP-162, IDs must not have the form of a UUID. + string api_version_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for UpdateApiVersion. +message UpdateApiVersionRequest { + // Required. The version to update. + // + // The `name` field is used to identify the version to update. + // Format: `projects/*/locations/*/apis/*/versions/*` + ApiVersion api_version = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. If omitted, all fields are updated that + // are set in the request message (fields set to default values are ignored). + // If an asterisk "*" is specified, all fields are updated, including fields + // that are unspecified/default in the request. + google.protobuf.FieldMask update_mask = 2; + + // If set to true, and the version is not found, a new version will be + // created. In this situation, `update_mask` is ignored. + bool allow_missing = 3; +} + +// Request message for DeleteApiVersion. +message DeleteApiVersionRequest { + // Required. The name of the version to delete. + // Format: `projects/*/locations/*/apis/*/versions/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiVersion" + } + ]; + + // If set to true, any child resources will also be deleted. + // (Otherwise, the request will only work if there are no child resources.) + bool force = 2; +} + +// Request message for ListApiSpecs. +message ListApiSpecsRequest { + // Required. The parent, which owns this collection of specs. + // Format: `projects/*/locations/*/apis/*/versions/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apigeeregistry.googleapis.com/ApiSpec" + } + ]; + + // The maximum number of specs to return. + // The service may return fewer than this value. + // If unspecified, at most 50 values will be returned. + // The maximum is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListApiSpecs` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListApiSpecs` must match + // the call that provided the page token. + string page_token = 3; + + // An expression that can be used to filter the list. Filters use the Common + // Expression Language and can refer to all message fields except contents. + string filter = 4; +} + +// Response message for ListApiSpecs. +message ListApiSpecsResponse { + // The specs from the specified publisher. + repeated ApiSpec api_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; +} + +// Request message for GetApiSpec. +message GetApiSpecRequest { + // Required. The name of the spec to retrieve. + // Format: `projects/*/locations/*/apis/*/versions/*/specs/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiSpec" + } + ]; +} + +// Request message for GetApiSpecContents. +message GetApiSpecContentsRequest { + // Required. The name of the spec whose contents should be retrieved. + // Format: `projects/*/locations/*/apis/*/versions/*/specs/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiSpec" + } + ]; +} + +// Request message for CreateApiSpec. +message CreateApiSpecRequest { + // Required. The parent, which owns this collection of specs. + // Format: `projects/*/locations/*/apis/*/versions/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apigeeregistry.googleapis.com/ApiSpec" + } + ]; + + // Required. The spec to create. + ApiSpec api_spec = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the spec, which will become the final component of + // the spec's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + // + // Following AIP-162, IDs must not have the form of a UUID. + string api_spec_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for UpdateApiSpec. +message UpdateApiSpecRequest { + // Required. The spec to update. + // + // The `name` field is used to identify the spec to update. + // Format: `projects/*/locations/*/apis/*/versions/*/specs/*` + ApiSpec api_spec = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. If omitted, all fields are updated that + // are set in the request message (fields set to default values are ignored). + // If an asterisk "*" is specified, all fields are updated, including fields + // that are unspecified/default in the request. + google.protobuf.FieldMask update_mask = 2; + + // If set to true, and the spec is not found, a new spec will be created. + // In this situation, `update_mask` is ignored. + bool allow_missing = 3; +} + +// Request message for DeleteApiSpec. +message DeleteApiSpecRequest { + // Required. The name of the spec to delete. + // Format: `projects/*/locations/*/apis/*/versions/*/specs/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiSpec" + } + ]; + + // If set to true, any child resources will also be deleted. + // (Otherwise, the request will only work if there are no child resources.) + bool force = 2; +} + +// Request message for TagApiSpecRevision. +message TagApiSpecRevisionRequest { + // Required. The name of the spec to be tagged, including the revision ID. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiSpec" + } + ]; + + // Required. The tag to apply. + // The tag should be at most 40 characters, and match `[a-z][a-z0-9-]{3,39}`. + string tag = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for ListApiSpecRevisions. +message ListApiSpecRevisionsRequest { + // Required. The name of the spec to list revisions for. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiSpec" + } + ]; + + // The maximum number of revisions to return per page. + int32 page_size = 2; + + // The page token, received from a previous ListApiSpecRevisions call. + // Provide this to retrieve the subsequent page. + string page_token = 3; +} + +// Response message for ListApiSpecRevisionsResponse. +message ListApiSpecRevisionsResponse { + // The revisions of the spec. + repeated ApiSpec api_specs = 1; + + // A token that 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; +} + +// Request message for RollbackApiSpec. +message RollbackApiSpecRequest { + // Required. The spec being rolled back. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiSpec" + } + ]; + + // Required. The revision ID to roll back to. + // It must be a revision of the same spec. + // + // Example: `c7cfa2a8` + string revision_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DeleteApiSpecRevision. +message DeleteApiSpecRevisionRequest { + // Required. The name of the spec revision to be deleted, + // with a revision ID explicitly included. + // + // Example: + // `projects/sample/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml@c7cfa2a8` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiSpec" + } + ]; +} + +// Request message for ListApiDeployments. +message ListApiDeploymentsRequest { + // Required. The parent, which owns this collection of deployments. + // Format: `projects/*/locations/*/apis/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apigeeregistry.googleapis.com/ApiDeployment" + } + ]; + + // The maximum number of deployments to return. + // The service may return fewer than this value. + // If unspecified, at most 50 values will be returned. + // The maximum is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListApiDeployments` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListApiDeployments` must + // match the call that provided the page token. + string page_token = 3; + + // An expression that can be used to filter the list. Filters use the Common + // Expression Language and can refer to all message fields. + string filter = 4; +} + +// Response message for ListApiDeployments. +message ListApiDeploymentsResponse { + // The deployments from the specified publisher. + repeated ApiDeployment api_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; +} + +// Request message for GetApiDeployment. +message GetApiDeploymentRequest { + // Required. The name of the deployment to retrieve. + // Format: `projects/*/locations/*/apis/*/deployments/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiDeployment" + } + ]; +} + +// Request message for CreateApiDeployment. +message CreateApiDeploymentRequest { + // Required. The parent, which owns this collection of deployments. + // Format: `projects/*/locations/*/apis/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apigeeregistry.googleapis.com/ApiDeployment" + } + ]; + + // Required. The deployment to create. + ApiDeployment api_deployment = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the deployment, which will become the final component of + // the deployment's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + // + // Following AIP-162, IDs must not have the form of a UUID. + string api_deployment_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for UpdateApiDeployment. +message UpdateApiDeploymentRequest { + // Required. The deployment to update. + // + // The `name` field is used to identify the deployment to update. + // Format: `projects/*/locations/*/apis/*/deployments/*` + ApiDeployment api_deployment = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. If omitted, all fields are updated that + // are set in the request message (fields set to default values are ignored). + // If an asterisk "*" is specified, all fields are updated, including fields + // that are unspecified/default in the request. + google.protobuf.FieldMask update_mask = 2; + + // If set to true, and the deployment is not found, a new deployment will be + // created. In this situation, `update_mask` is ignored. + bool allow_missing = 3; +} + +// Request message for DeleteApiDeployment. +message DeleteApiDeploymentRequest { + // Required. The name of the deployment to delete. + // Format: `projects/*/locations/*/apis/*/deployments/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiDeployment" + } + ]; + + // If set to true, any child resources will also be deleted. + // (Otherwise, the request will only work if there are no child resources.) + bool force = 2; +} + +// Request message for TagApiDeploymentRevision. +message TagApiDeploymentRevisionRequest { + // Required. The name of the deployment to be tagged, including the revision ID. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiDeployment" + } + ]; + + // Required. The tag to apply. + // The tag should be at most 40 characters, and match `[a-z][a-z0-9-]{3,39}`. + string tag = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for ListApiDeploymentRevisions. +message ListApiDeploymentRevisionsRequest { + // Required. The name of the deployment to list revisions for. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiDeployment" + } + ]; + + // The maximum number of revisions to return per page. + int32 page_size = 2; + + // The page token, received from a previous ListApiDeploymentRevisions call. + // Provide this to retrieve the subsequent page. + string page_token = 3; +} + +// Response message for ListApiDeploymentRevisionsResponse. +message ListApiDeploymentRevisionsResponse { + // The revisions of the deployment. + repeated ApiDeployment api_deployments = 1; + + // A token that 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; +} + +// Request message for RollbackApiDeployment. +message RollbackApiDeploymentRequest { + // Required. The deployment being rolled back. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiDeployment" + } + ]; + + // Required. The revision ID to roll back to. + // It must be a revision of the same deployment. + // + // Example: `c7cfa2a8` + string revision_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DeleteApiDeploymentRevision. +message DeleteApiDeploymentRevisionRequest { + // Required. The name of the deployment revision to be deleted, + // with a revision ID explicitly included. + // + // Example: + // `projects/sample/locations/global/apis/petstore/deployments/prod@c7cfa2a8` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/ApiDeployment" + } + ]; +} + +// Request message for ListArtifacts. +message ListArtifactsRequest { + // Required. The parent, which owns this collection of artifacts. + // Format: `{parent}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apigeeregistry.googleapis.com/Artifact" + } + ]; + + // The maximum number of artifacts to return. + // The service may return fewer than this value. + // If unspecified, at most 50 values will be returned. + // The maximum is 1000; values above 1000 will be coerced to 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListArtifacts` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListArtifacts` must + // match the call that provided the page token. + string page_token = 3; + + // An expression that can be used to filter the list. Filters use the Common + // Expression Language and can refer to all message fields except contents. + string filter = 4; +} + +// Response message for ListArtifacts. +message ListArtifactsResponse { + // The artifacts from the specified publisher. + repeated Artifact artifacts = 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; +} + +// Request message for GetArtifact. +message GetArtifactRequest { + // Required. The name of the artifact to retrieve. + // Format: `{parent}/artifacts/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/Artifact" + } + ]; +} + +// Request message for GetArtifactContents. +message GetArtifactContentsRequest { + // Required. The name of the artifact whose contents should be retrieved. + // Format: `{parent}/artifacts/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/Artifact" + } + ]; +} + +// Request message for CreateArtifact. +message CreateArtifactRequest { + // Required. The parent, which owns this collection of artifacts. + // Format: `{parent}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "apigeeregistry.googleapis.com/Artifact" + } + ]; + + // Required. The artifact to create. + Artifact artifact = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the artifact, which will become the final component of + // the artifact's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + // + // Following AIP-162, IDs must not have the form of a UUID. + string artifact_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for ReplaceArtifact. +message ReplaceArtifactRequest { + // Required. The artifact to replace. + // + // The `name` field is used to identify the artifact to replace. + // Format: `{parent}/artifacts/*` + Artifact artifact = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for DeleteArtifact. +message DeleteArtifactRequest { + // Required. The name of the artifact to delete. + // Format: `{parent}/artifacts/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "apigeeregistry.googleapis.com/Artifact" + } + ]; +} diff --git a/packages/google-cloud-apigeeregistry/protos/protos.d.ts b/packages/google-cloud-apigeeregistry/protos/protos.d.ts new file mode 100644 index 00000000000..8a72b619b04 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/protos/protos.d.ts @@ -0,0 +1,13878 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace apigeeregistry. */ + namespace apigeeregistry { + + /** Namespace v1. */ + namespace v1 { + + /** 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 CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInstance(request: google.cloud.apigeeregistry.v1.ICreateInstanceRequest, callback: google.cloud.apigeeregistry.v1.Provisioning.CreateInstanceCallback): void; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.cloud.apigeeregistry.v1.ICreateInstanceRequest): Promise; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteInstance(request: google.cloud.apigeeregistry.v1.IDeleteInstanceRequest, callback: google.cloud.apigeeregistry.v1.Provisioning.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.cloud.apigeeregistry.v1.IDeleteInstanceRequest): Promise; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Instance + */ + public getInstance(request: google.cloud.apigeeregistry.v1.IGetInstanceRequest, callback: google.cloud.apigeeregistry.v1.Provisioning.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.cloud.apigeeregistry.v1.IGetInstanceRequest): Promise; + } + + namespace Provisioning { + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Provisioning|createInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Provisioning|deleteInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Provisioning|getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.Instance) => void; + } + + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { + + /** CreateInstanceRequest parent */ + parent?: (string|null); + + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateInstanceRequest instance */ + instance?: (google.cloud.apigeeregistry.v1.IInstance|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { + + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest instance. */ + public instance?: (google.cloud.apigeeregistry.v1.IInstance|null); + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.ICreateInstanceRequest): google.cloud.apigeeregistry.v1.CreateInstanceRequest; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.CreateInstanceRequest; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.CreateInstanceRequest; + + /** + * Verifies a CreateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.CreateInstanceRequest; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @param message CreateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInstanceRequest. */ + interface IDeleteInstanceRequest { + + /** DeleteInstanceRequest name */ + name?: (string|null); + } + + /** Represents a DeleteInstanceRequest. */ + class DeleteInstanceRequest implements IDeleteInstanceRequest { + + /** + * Constructs a new DeleteInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IDeleteInstanceRequest); + + /** DeleteInstanceRequest name. */ + public name: string; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IDeleteInstanceRequest): google.cloud.apigeeregistry.v1.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.DeleteInstanceRequest; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.DeleteInstanceRequest; + + /** + * Verifies a DeleteInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.DeleteInstanceRequest; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { + + /** GetInstanceRequest name */ + name?: (string|null); + } + + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { + + /** + * Constructs a new GetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IGetInstanceRequest); + + /** GetInstanceRequest name. */ + public name: string; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IGetInstanceRequest): google.cloud.apigeeregistry.v1.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.GetInstanceRequest; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.GetInstanceRequest; + + /** + * Verifies a GetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.GetInstanceRequest; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @param message GetInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceRequest + * @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 cancellationRequested */ + cancellationRequested?: (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.apigeeregistry.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 cancellationRequested. */ + public cancellationRequested: 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.apigeeregistry.v1.IOperationMetadata): google.cloud.apigeeregistry.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.apigeeregistry.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.apigeeregistry.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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 Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance state */ + state?: (google.cloud.apigeeregistry.v1.Instance.State|keyof typeof google.cloud.apigeeregistry.v1.Instance.State|null); + + /** Instance stateMessage */ + stateMessage?: (string|null); + + /** Instance config */ + config?: (google.cloud.apigeeregistry.v1.Instance.IConfig|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance state. */ + public state: (google.cloud.apigeeregistry.v1.Instance.State|keyof typeof google.cloud.apigeeregistry.v1.Instance.State); + + /** Instance stateMessage. */ + public stateMessage: string; + + /** Instance config. */ + public config?: (google.cloud.apigeeregistry.v1.Instance.IConfig|null); + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IInstance): google.cloud.apigeeregistry.v1.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.apigeeregistry.v1.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.Instance; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.Instance; + + /** + * Verifies an Instance message. + * @param message Plain 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 Instance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.Instance; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @param message Instance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Instance { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + INACTIVE = 1, + CREATING = 2, + ACTIVE = 3, + UPDATING = 4, + DELETING = 5, + FAILED = 6 + } + + /** Properties of a Config. */ + interface IConfig { + + /** Config location */ + location?: (string|null); + + /** 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.apigeeregistry.v1.Instance.IConfig); + + /** Config location. */ + public location: string; + + /** 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.apigeeregistry.v1.Instance.IConfig): google.cloud.apigeeregistry.v1.Instance.Config; + + /** + * Encodes the specified Config message. Does not implicitly {@link google.cloud.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.IConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Config message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.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; + } + } + + /** Properties of an Api. */ + interface IApi { + + /** Api name */ + name?: (string|null); + + /** Api displayName */ + displayName?: (string|null); + + /** Api description */ + description?: (string|null); + + /** Api createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Api updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Api availability */ + availability?: (string|null); + + /** Api recommendedVersion */ + recommendedVersion?: (string|null); + + /** Api recommendedDeployment */ + recommendedDeployment?: (string|null); + + /** Api labels */ + labels?: ({ [k: string]: string }|null); + + /** Api annotations */ + annotations?: ({ [k: string]: string }|null); + } + + /** Represents an Api. */ + class Api implements IApi { + + /** + * Constructs a new Api. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IApi); + + /** Api name. */ + public name: string; + + /** Api displayName. */ + public displayName: string; + + /** Api description. */ + public description: string; + + /** Api createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Api updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Api availability. */ + public availability: string; + + /** Api recommendedVersion. */ + public recommendedVersion: string; + + /** Api recommendedDeployment. */ + public recommendedDeployment: string; + + /** Api labels. */ + public labels: { [k: string]: string }; + + /** Api annotations. */ + public annotations: { [k: string]: string }; + + /** + * Creates a new Api instance using the specified properties. + * @param [properties] Properties to set + * @returns Api instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IApi): google.cloud.apigeeregistry.v1.Api; + + /** + * Encodes the specified Api message. Does not implicitly {@link google.cloud.apigeeregistry.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.apigeeregistry.v1.IApi, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Api message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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 an ApiVersion. */ + interface IApiVersion { + + /** ApiVersion name */ + name?: (string|null); + + /** ApiVersion displayName */ + displayName?: (string|null); + + /** ApiVersion description */ + description?: (string|null); + + /** ApiVersion createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ApiVersion updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ApiVersion state */ + state?: (string|null); + + /** ApiVersion labels */ + labels?: ({ [k: string]: string }|null); + + /** ApiVersion annotations */ + annotations?: ({ [k: string]: string }|null); + } + + /** Represents an ApiVersion. */ + class ApiVersion implements IApiVersion { + + /** + * Constructs a new ApiVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IApiVersion); + + /** ApiVersion name. */ + public name: string; + + /** ApiVersion displayName. */ + public displayName: string; + + /** ApiVersion description. */ + public description: string; + + /** ApiVersion createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ApiVersion updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ApiVersion state. */ + public state: string; + + /** ApiVersion labels. */ + public labels: { [k: string]: string }; + + /** ApiVersion annotations. */ + public annotations: { [k: string]: string }; + + /** + * Creates a new ApiVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiVersion instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IApiVersion): google.cloud.apigeeregistry.v1.ApiVersion; + + /** + * Encodes the specified ApiVersion message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiVersion.verify|verify} messages. + * @param message ApiVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IApiVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiVersion message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiVersion.verify|verify} messages. + * @param message ApiVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IApiVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.ApiVersion; + + /** + * Decodes an ApiVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.ApiVersion; + + /** + * Verifies an ApiVersion message. + * @param message Plain 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 ApiVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ApiVersion; + + /** + * Creates a plain object from an ApiVersion message. Also converts values to other types if specified. + * @param message ApiVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ApiVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiVersion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApiSpec. */ + interface IApiSpec { + + /** ApiSpec name */ + name?: (string|null); + + /** ApiSpec filename */ + filename?: (string|null); + + /** ApiSpec description */ + description?: (string|null); + + /** ApiSpec revisionId */ + revisionId?: (string|null); + + /** ApiSpec createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ApiSpec revisionCreateTime */ + revisionCreateTime?: (google.protobuf.ITimestamp|null); + + /** ApiSpec revisionUpdateTime */ + revisionUpdateTime?: (google.protobuf.ITimestamp|null); + + /** ApiSpec mimeType */ + mimeType?: (string|null); + + /** ApiSpec sizeBytes */ + sizeBytes?: (number|null); + + /** ApiSpec hash */ + hash?: (string|null); + + /** ApiSpec sourceUri */ + sourceUri?: (string|null); + + /** ApiSpec contents */ + contents?: (Uint8Array|string|null); + + /** ApiSpec labels */ + labels?: ({ [k: string]: string }|null); + + /** ApiSpec annotations */ + annotations?: ({ [k: string]: string }|null); + } + + /** Represents an ApiSpec. */ + class ApiSpec implements IApiSpec { + + /** + * Constructs a new ApiSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IApiSpec); + + /** ApiSpec name. */ + public name: string; + + /** ApiSpec filename. */ + public filename: string; + + /** ApiSpec description. */ + public description: string; + + /** ApiSpec revisionId. */ + public revisionId: string; + + /** ApiSpec createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ApiSpec revisionCreateTime. */ + public revisionCreateTime?: (google.protobuf.ITimestamp|null); + + /** ApiSpec revisionUpdateTime. */ + public revisionUpdateTime?: (google.protobuf.ITimestamp|null); + + /** ApiSpec mimeType. */ + public mimeType: string; + + /** ApiSpec sizeBytes. */ + public sizeBytes: number; + + /** ApiSpec hash. */ + public hash: string; + + /** ApiSpec sourceUri. */ + public sourceUri: string; + + /** ApiSpec contents. */ + public contents: (Uint8Array|string); + + /** ApiSpec labels. */ + public labels: { [k: string]: string }; + + /** ApiSpec annotations. */ + public annotations: { [k: string]: string }; + + /** + * Creates a new ApiSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiSpec instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IApiSpec): google.cloud.apigeeregistry.v1.ApiSpec; + + /** + * Encodes the specified ApiSpec message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiSpec.verify|verify} messages. + * @param message ApiSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IApiSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiSpec message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiSpec.verify|verify} messages. + * @param message ApiSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IApiSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.ApiSpec; + + /** + * Decodes an ApiSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.ApiSpec; + + /** + * Verifies an ApiSpec message. + * @param message Plain 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 ApiSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ApiSpec; + + /** + * Creates a plain object from an ApiSpec message. Also converts values to other types if specified. + * @param message ApiSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ApiSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApiDeployment. */ + interface IApiDeployment { + + /** ApiDeployment name */ + name?: (string|null); + + /** ApiDeployment displayName */ + displayName?: (string|null); + + /** ApiDeployment description */ + description?: (string|null); + + /** ApiDeployment revisionId */ + revisionId?: (string|null); + + /** ApiDeployment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ApiDeployment revisionCreateTime */ + revisionCreateTime?: (google.protobuf.ITimestamp|null); + + /** ApiDeployment revisionUpdateTime */ + revisionUpdateTime?: (google.protobuf.ITimestamp|null); + + /** ApiDeployment apiSpecRevision */ + apiSpecRevision?: (string|null); + + /** ApiDeployment endpointUri */ + endpointUri?: (string|null); + + /** ApiDeployment externalChannelUri */ + externalChannelUri?: (string|null); + + /** ApiDeployment intendedAudience */ + intendedAudience?: (string|null); + + /** ApiDeployment accessGuidance */ + accessGuidance?: (string|null); + + /** ApiDeployment labels */ + labels?: ({ [k: string]: string }|null); + + /** ApiDeployment annotations */ + annotations?: ({ [k: string]: string }|null); + } + + /** Represents an ApiDeployment. */ + class ApiDeployment implements IApiDeployment { + + /** + * Constructs a new ApiDeployment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IApiDeployment); + + /** ApiDeployment name. */ + public name: string; + + /** ApiDeployment displayName. */ + public displayName: string; + + /** ApiDeployment description. */ + public description: string; + + /** ApiDeployment revisionId. */ + public revisionId: string; + + /** ApiDeployment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ApiDeployment revisionCreateTime. */ + public revisionCreateTime?: (google.protobuf.ITimestamp|null); + + /** ApiDeployment revisionUpdateTime. */ + public revisionUpdateTime?: (google.protobuf.ITimestamp|null); + + /** ApiDeployment apiSpecRevision. */ + public apiSpecRevision: string; + + /** ApiDeployment endpointUri. */ + public endpointUri: string; + + /** ApiDeployment externalChannelUri. */ + public externalChannelUri: string; + + /** ApiDeployment intendedAudience. */ + public intendedAudience: string; + + /** ApiDeployment accessGuidance. */ + public accessGuidance: string; + + /** ApiDeployment labels. */ + public labels: { [k: string]: string }; + + /** ApiDeployment annotations. */ + public annotations: { [k: string]: string }; + + /** + * Creates a new ApiDeployment instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiDeployment instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IApiDeployment): google.cloud.apigeeregistry.v1.ApiDeployment; + + /** + * Encodes the specified ApiDeployment message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiDeployment.verify|verify} messages. + * @param message ApiDeployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IApiDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiDeployment message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiDeployment.verify|verify} messages. + * @param message ApiDeployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IApiDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiDeployment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.ApiDeployment; + + /** + * Decodes an ApiDeployment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.ApiDeployment; + + /** + * Verifies an ApiDeployment message. + * @param message Plain 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 ApiDeployment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiDeployment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ApiDeployment; + + /** + * Creates a plain object from an ApiDeployment message. Also converts values to other types if specified. + * @param message ApiDeployment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ApiDeployment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiDeployment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiDeployment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Artifact. */ + interface IArtifact { + + /** Artifact name */ + name?: (string|null); + + /** Artifact createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Artifact updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Artifact mimeType */ + mimeType?: (string|null); + + /** Artifact sizeBytes */ + sizeBytes?: (number|null); + + /** Artifact hash */ + hash?: (string|null); + + /** Artifact contents */ + contents?: (Uint8Array|string|null); + } + + /** Represents an Artifact. */ + class Artifact implements IArtifact { + + /** + * Constructs a new Artifact. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IArtifact); + + /** Artifact name. */ + public name: string; + + /** Artifact createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Artifact updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Artifact mimeType. */ + public mimeType: string; + + /** Artifact sizeBytes. */ + public sizeBytes: number; + + /** Artifact hash. */ + public hash: string; + + /** Artifact contents. */ + public contents: (Uint8Array|string); + + /** + * Creates a new Artifact instance using the specified properties. + * @param [properties] Properties to set + * @returns Artifact instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IArtifact): google.cloud.apigeeregistry.v1.Artifact; + + /** + * Encodes the specified Artifact message. Does not implicitly {@link google.cloud.apigeeregistry.v1.Artifact.verify|verify} messages. + * @param message Artifact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IArtifact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Artifact message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.Artifact.verify|verify} messages. + * @param message Artifact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IArtifact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Artifact message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Artifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.Artifact; + + /** + * Decodes an Artifact message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Artifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.Artifact; + + /** + * Verifies an Artifact message. + * @param message Plain 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 Artifact message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Artifact + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.Artifact; + + /** + * Creates a plain object from an Artifact message. Also converts values to other types if specified. + * @param message Artifact + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.Artifact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Artifact to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Artifact + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a Registry */ + class Registry extends $protobuf.rpc.Service { + + /** + * Constructs a new Registry 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 Registry 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): Registry; + + /** + * 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.apigeeregistry.v1.IListApisRequest, callback: google.cloud.apigeeregistry.v1.Registry.ListApisCallback): void; + + /** + * Calls ListApis. + * @param request ListApisRequest message or plain object + * @returns Promise + */ + public listApis(request: google.cloud.apigeeregistry.v1.IListApisRequest): 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.apigeeregistry.v1.IGetApiRequest, callback: google.cloud.apigeeregistry.v1.Registry.GetApiCallback): void; + + /** + * Calls GetApi. + * @param request GetApiRequest message or plain object + * @returns Promise + */ + public getApi(request: google.cloud.apigeeregistry.v1.IGetApiRequest): Promise; + + /** + * 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.apigeeregistry.v1.ICreateApiRequest, callback: google.cloud.apigeeregistry.v1.Registry.CreateApiCallback): void; + + /** + * Calls CreateApi. + * @param request CreateApiRequest message or plain object + * @returns Promise + */ + public createApi(request: google.cloud.apigeeregistry.v1.ICreateApiRequest): 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.apigeeregistry.v1.IUpdateApiRequest, callback: google.cloud.apigeeregistry.v1.Registry.UpdateApiCallback): void; + + /** + * Calls UpdateApi. + * @param request UpdateApiRequest message or plain object + * @returns Promise + */ + public updateApi(request: google.cloud.apigeeregistry.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.apigeeregistry.v1.IDeleteApiRequest, callback: google.cloud.apigeeregistry.v1.Registry.DeleteApiCallback): void; + + /** + * Calls DeleteApi. + * @param request DeleteApiRequest message or plain object + * @returns Promise + */ + public deleteApi(request: google.cloud.apigeeregistry.v1.IDeleteApiRequest): Promise; + + /** + * Calls ListApiVersions. + * @param request ListApiVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListApiVersionsResponse + */ + public listApiVersions(request: google.cloud.apigeeregistry.v1.IListApiVersionsRequest, callback: google.cloud.apigeeregistry.v1.Registry.ListApiVersionsCallback): void; + + /** + * Calls ListApiVersions. + * @param request ListApiVersionsRequest message or plain object + * @returns Promise + */ + public listApiVersions(request: google.cloud.apigeeregistry.v1.IListApiVersionsRequest): Promise; + + /** + * Calls GetApiVersion. + * @param request GetApiVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiVersion + */ + public getApiVersion(request: google.cloud.apigeeregistry.v1.IGetApiVersionRequest, callback: google.cloud.apigeeregistry.v1.Registry.GetApiVersionCallback): void; + + /** + * Calls GetApiVersion. + * @param request GetApiVersionRequest message or plain object + * @returns Promise + */ + public getApiVersion(request: google.cloud.apigeeregistry.v1.IGetApiVersionRequest): Promise; + + /** + * Calls CreateApiVersion. + * @param request CreateApiVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiVersion + */ + public createApiVersion(request: google.cloud.apigeeregistry.v1.ICreateApiVersionRequest, callback: google.cloud.apigeeregistry.v1.Registry.CreateApiVersionCallback): void; + + /** + * Calls CreateApiVersion. + * @param request CreateApiVersionRequest message or plain object + * @returns Promise + */ + public createApiVersion(request: google.cloud.apigeeregistry.v1.ICreateApiVersionRequest): Promise; + + /** + * Calls UpdateApiVersion. + * @param request UpdateApiVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiVersion + */ + public updateApiVersion(request: google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest, callback: google.cloud.apigeeregistry.v1.Registry.UpdateApiVersionCallback): void; + + /** + * Calls UpdateApiVersion. + * @param request UpdateApiVersionRequest message or plain object + * @returns Promise + */ + public updateApiVersion(request: google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest): Promise; + + /** + * Calls DeleteApiVersion. + * @param request DeleteApiVersionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteApiVersion(request: google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest, callback: google.cloud.apigeeregistry.v1.Registry.DeleteApiVersionCallback): void; + + /** + * Calls DeleteApiVersion. + * @param request DeleteApiVersionRequest message or plain object + * @returns Promise + */ + public deleteApiVersion(request: google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest): Promise; + + /** + * Calls ListApiSpecs. + * @param request ListApiSpecsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListApiSpecsResponse + */ + public listApiSpecs(request: google.cloud.apigeeregistry.v1.IListApiSpecsRequest, callback: google.cloud.apigeeregistry.v1.Registry.ListApiSpecsCallback): void; + + /** + * Calls ListApiSpecs. + * @param request ListApiSpecsRequest message or plain object + * @returns Promise + */ + public listApiSpecs(request: google.cloud.apigeeregistry.v1.IListApiSpecsRequest): Promise; + + /** + * Calls GetApiSpec. + * @param request GetApiSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiSpec + */ + public getApiSpec(request: google.cloud.apigeeregistry.v1.IGetApiSpecRequest, callback: google.cloud.apigeeregistry.v1.Registry.GetApiSpecCallback): void; + + /** + * Calls GetApiSpec. + * @param request GetApiSpecRequest message or plain object + * @returns Promise + */ + public getApiSpec(request: google.cloud.apigeeregistry.v1.IGetApiSpecRequest): Promise; + + /** + * Calls GetApiSpecContents. + * @param request GetApiSpecContentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HttpBody + */ + public getApiSpecContents(request: google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest, callback: google.cloud.apigeeregistry.v1.Registry.GetApiSpecContentsCallback): void; + + /** + * Calls GetApiSpecContents. + * @param request GetApiSpecContentsRequest message or plain object + * @returns Promise + */ + public getApiSpecContents(request: google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest): Promise; + + /** + * Calls CreateApiSpec. + * @param request CreateApiSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiSpec + */ + public createApiSpec(request: google.cloud.apigeeregistry.v1.ICreateApiSpecRequest, callback: google.cloud.apigeeregistry.v1.Registry.CreateApiSpecCallback): void; + + /** + * Calls CreateApiSpec. + * @param request CreateApiSpecRequest message or plain object + * @returns Promise + */ + public createApiSpec(request: google.cloud.apigeeregistry.v1.ICreateApiSpecRequest): Promise; + + /** + * Calls UpdateApiSpec. + * @param request UpdateApiSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiSpec + */ + public updateApiSpec(request: google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest, callback: google.cloud.apigeeregistry.v1.Registry.UpdateApiSpecCallback): void; + + /** + * Calls UpdateApiSpec. + * @param request UpdateApiSpecRequest message or plain object + * @returns Promise + */ + public updateApiSpec(request: google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest): Promise; + + /** + * Calls DeleteApiSpec. + * @param request DeleteApiSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteApiSpec(request: google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest, callback: google.cloud.apigeeregistry.v1.Registry.DeleteApiSpecCallback): void; + + /** + * Calls DeleteApiSpec. + * @param request DeleteApiSpecRequest message or plain object + * @returns Promise + */ + public deleteApiSpec(request: google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest): Promise; + + /** + * Calls TagApiSpecRevision. + * @param request TagApiSpecRevisionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiSpec + */ + public tagApiSpecRevision(request: google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest, callback: google.cloud.apigeeregistry.v1.Registry.TagApiSpecRevisionCallback): void; + + /** + * Calls TagApiSpecRevision. + * @param request TagApiSpecRevisionRequest message or plain object + * @returns Promise + */ + public tagApiSpecRevision(request: google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest): Promise; + + /** + * Calls ListApiSpecRevisions. + * @param request ListApiSpecRevisionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListApiSpecRevisionsResponse + */ + public listApiSpecRevisions(request: google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, callback: google.cloud.apigeeregistry.v1.Registry.ListApiSpecRevisionsCallback): void; + + /** + * Calls ListApiSpecRevisions. + * @param request ListApiSpecRevisionsRequest message or plain object + * @returns Promise + */ + public listApiSpecRevisions(request: google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest): Promise; + + /** + * Calls RollbackApiSpec. + * @param request RollbackApiSpecRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiSpec + */ + public rollbackApiSpec(request: google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest, callback: google.cloud.apigeeregistry.v1.Registry.RollbackApiSpecCallback): void; + + /** + * Calls RollbackApiSpec. + * @param request RollbackApiSpecRequest message or plain object + * @returns Promise + */ + public rollbackApiSpec(request: google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest): Promise; + + /** + * Calls DeleteApiSpecRevision. + * @param request DeleteApiSpecRevisionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiSpec + */ + public deleteApiSpecRevision(request: google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest, callback: google.cloud.apigeeregistry.v1.Registry.DeleteApiSpecRevisionCallback): void; + + /** + * Calls DeleteApiSpecRevision. + * @param request DeleteApiSpecRevisionRequest message or plain object + * @returns Promise + */ + public deleteApiSpecRevision(request: google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest): Promise; + + /** + * Calls ListApiDeployments. + * @param request ListApiDeploymentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListApiDeploymentsResponse + */ + public listApiDeployments(request: google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, callback: google.cloud.apigeeregistry.v1.Registry.ListApiDeploymentsCallback): void; + + /** + * Calls ListApiDeployments. + * @param request ListApiDeploymentsRequest message or plain object + * @returns Promise + */ + public listApiDeployments(request: google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest): Promise; + + /** + * Calls GetApiDeployment. + * @param request GetApiDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiDeployment + */ + public getApiDeployment(request: google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest, callback: google.cloud.apigeeregistry.v1.Registry.GetApiDeploymentCallback): void; + + /** + * Calls GetApiDeployment. + * @param request GetApiDeploymentRequest message or plain object + * @returns Promise + */ + public getApiDeployment(request: google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest): Promise; + + /** + * Calls CreateApiDeployment. + * @param request CreateApiDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiDeployment + */ + public createApiDeployment(request: google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest, callback: google.cloud.apigeeregistry.v1.Registry.CreateApiDeploymentCallback): void; + + /** + * Calls CreateApiDeployment. + * @param request CreateApiDeploymentRequest message or plain object + * @returns Promise + */ + public createApiDeployment(request: google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest): Promise; + + /** + * Calls UpdateApiDeployment. + * @param request UpdateApiDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiDeployment + */ + public updateApiDeployment(request: google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest, callback: google.cloud.apigeeregistry.v1.Registry.UpdateApiDeploymentCallback): void; + + /** + * Calls UpdateApiDeployment. + * @param request UpdateApiDeploymentRequest message or plain object + * @returns Promise + */ + public updateApiDeployment(request: google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest): Promise; + + /** + * Calls DeleteApiDeployment. + * @param request DeleteApiDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteApiDeployment(request: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest, callback: google.cloud.apigeeregistry.v1.Registry.DeleteApiDeploymentCallback): void; + + /** + * Calls DeleteApiDeployment. + * @param request DeleteApiDeploymentRequest message or plain object + * @returns Promise + */ + public deleteApiDeployment(request: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest): Promise; + + /** + * Calls TagApiDeploymentRevision. + * @param request TagApiDeploymentRevisionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiDeployment + */ + public tagApiDeploymentRevision(request: google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest, callback: google.cloud.apigeeregistry.v1.Registry.TagApiDeploymentRevisionCallback): void; + + /** + * Calls TagApiDeploymentRevision. + * @param request TagApiDeploymentRevisionRequest message or plain object + * @returns Promise + */ + public tagApiDeploymentRevision(request: google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest): Promise; + + /** + * Calls ListApiDeploymentRevisions. + * @param request ListApiDeploymentRevisionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListApiDeploymentRevisionsResponse + */ + public listApiDeploymentRevisions(request: google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, callback: google.cloud.apigeeregistry.v1.Registry.ListApiDeploymentRevisionsCallback): void; + + /** + * Calls ListApiDeploymentRevisions. + * @param request ListApiDeploymentRevisionsRequest message or plain object + * @returns Promise + */ + public listApiDeploymentRevisions(request: google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest): Promise; + + /** + * Calls RollbackApiDeployment. + * @param request RollbackApiDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiDeployment + */ + public rollbackApiDeployment(request: google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest, callback: google.cloud.apigeeregistry.v1.Registry.RollbackApiDeploymentCallback): void; + + /** + * Calls RollbackApiDeployment. + * @param request RollbackApiDeploymentRequest message or plain object + * @returns Promise + */ + public rollbackApiDeployment(request: google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest): Promise; + + /** + * Calls DeleteApiDeploymentRevision. + * @param request DeleteApiDeploymentRevisionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ApiDeployment + */ + public deleteApiDeploymentRevision(request: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest, callback: google.cloud.apigeeregistry.v1.Registry.DeleteApiDeploymentRevisionCallback): void; + + /** + * Calls DeleteApiDeploymentRevision. + * @param request DeleteApiDeploymentRevisionRequest message or plain object + * @returns Promise + */ + public deleteApiDeploymentRevision(request: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest): Promise; + + /** + * Calls ListArtifacts. + * @param request ListArtifactsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListArtifactsResponse + */ + public listArtifacts(request: google.cloud.apigeeregistry.v1.IListArtifactsRequest, callback: google.cloud.apigeeregistry.v1.Registry.ListArtifactsCallback): void; + + /** + * Calls ListArtifacts. + * @param request ListArtifactsRequest message or plain object + * @returns Promise + */ + public listArtifacts(request: google.cloud.apigeeregistry.v1.IListArtifactsRequest): Promise; + + /** + * Calls GetArtifact. + * @param request GetArtifactRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Artifact + */ + public getArtifact(request: google.cloud.apigeeregistry.v1.IGetArtifactRequest, callback: google.cloud.apigeeregistry.v1.Registry.GetArtifactCallback): void; + + /** + * Calls GetArtifact. + * @param request GetArtifactRequest message or plain object + * @returns Promise + */ + public getArtifact(request: google.cloud.apigeeregistry.v1.IGetArtifactRequest): Promise; + + /** + * Calls GetArtifactContents. + * @param request GetArtifactContentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HttpBody + */ + public getArtifactContents(request: google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest, callback: google.cloud.apigeeregistry.v1.Registry.GetArtifactContentsCallback): void; + + /** + * Calls GetArtifactContents. + * @param request GetArtifactContentsRequest message or plain object + * @returns Promise + */ + public getArtifactContents(request: google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest): Promise; + + /** + * Calls CreateArtifact. + * @param request CreateArtifactRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Artifact + */ + public createArtifact(request: google.cloud.apigeeregistry.v1.ICreateArtifactRequest, callback: google.cloud.apigeeregistry.v1.Registry.CreateArtifactCallback): void; + + /** + * Calls CreateArtifact. + * @param request CreateArtifactRequest message or plain object + * @returns Promise + */ + public createArtifact(request: google.cloud.apigeeregistry.v1.ICreateArtifactRequest): Promise; + + /** + * Calls ReplaceArtifact. + * @param request ReplaceArtifactRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Artifact + */ + public replaceArtifact(request: google.cloud.apigeeregistry.v1.IReplaceArtifactRequest, callback: google.cloud.apigeeregistry.v1.Registry.ReplaceArtifactCallback): void; + + /** + * Calls ReplaceArtifact. + * @param request ReplaceArtifactRequest message or plain object + * @returns Promise + */ + public replaceArtifact(request: google.cloud.apigeeregistry.v1.IReplaceArtifactRequest): Promise; + + /** + * Calls DeleteArtifact. + * @param request DeleteArtifactRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteArtifact(request: google.cloud.apigeeregistry.v1.IDeleteArtifactRequest, callback: google.cloud.apigeeregistry.v1.Registry.DeleteArtifactCallback): void; + + /** + * Calls DeleteArtifact. + * @param request DeleteArtifactRequest message or plain object + * @returns Promise + */ + public deleteArtifact(request: google.cloud.apigeeregistry.v1.IDeleteArtifactRequest): Promise; + } + + namespace Registry { + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApis}. + * @param error Error, if any + * @param [response] ListApisResponse + */ + type ListApisCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ListApisResponse) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getApi}. + * @param error Error, if any + * @param [response] Api + */ + type GetApiCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.Api) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|createApi}. + * @param error Error, if any + * @param [response] Api + */ + type CreateApiCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.Api) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|updateApi}. + * @param error Error, if any + * @param [response] Api + */ + type UpdateApiCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.Api) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|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.apigeeregistry.v1.Registry|listApiVersions}. + * @param error Error, if any + * @param [response] ListApiVersionsResponse + */ + type ListApiVersionsCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ListApiVersionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getApiVersion}. + * @param error Error, if any + * @param [response] ApiVersion + */ + type GetApiVersionCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiVersion) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|createApiVersion}. + * @param error Error, if any + * @param [response] ApiVersion + */ + type CreateApiVersionCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiVersion) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|updateApiVersion}. + * @param error Error, if any + * @param [response] ApiVersion + */ + type UpdateApiVersionCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiVersion) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApiVersion}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteApiVersionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApiSpecs}. + * @param error Error, if any + * @param [response] ListApiSpecsResponse + */ + type ListApiSpecsCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ListApiSpecsResponse) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getApiSpec}. + * @param error Error, if any + * @param [response] ApiSpec + */ + type GetApiSpecCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiSpec) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getApiSpecContents}. + * @param error Error, if any + * @param [response] HttpBody + */ + type GetApiSpecContentsCallback = (error: (Error|null), response?: google.api.HttpBody) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|createApiSpec}. + * @param error Error, if any + * @param [response] ApiSpec + */ + type CreateApiSpecCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiSpec) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|updateApiSpec}. + * @param error Error, if any + * @param [response] ApiSpec + */ + type UpdateApiSpecCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiSpec) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApiSpec}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteApiSpecCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|tagApiSpecRevision}. + * @param error Error, if any + * @param [response] ApiSpec + */ + type TagApiSpecRevisionCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiSpec) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApiSpecRevisions}. + * @param error Error, if any + * @param [response] ListApiSpecRevisionsResponse + */ + type ListApiSpecRevisionsCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|rollbackApiSpec}. + * @param error Error, if any + * @param [response] ApiSpec + */ + type RollbackApiSpecCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiSpec) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApiSpecRevision}. + * @param error Error, if any + * @param [response] ApiSpec + */ + type DeleteApiSpecRevisionCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiSpec) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApiDeployments}. + * @param error Error, if any + * @param [response] ListApiDeploymentsResponse + */ + type ListApiDeploymentsCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getApiDeployment}. + * @param error Error, if any + * @param [response] ApiDeployment + */ + type GetApiDeploymentCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiDeployment) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|createApiDeployment}. + * @param error Error, if any + * @param [response] ApiDeployment + */ + type CreateApiDeploymentCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiDeployment) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|updateApiDeployment}. + * @param error Error, if any + * @param [response] ApiDeployment + */ + type UpdateApiDeploymentCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiDeployment) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApiDeployment}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteApiDeploymentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|tagApiDeploymentRevision}. + * @param error Error, if any + * @param [response] ApiDeployment + */ + type TagApiDeploymentRevisionCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiDeployment) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApiDeploymentRevisions}. + * @param error Error, if any + * @param [response] ListApiDeploymentRevisionsResponse + */ + type ListApiDeploymentRevisionsCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|rollbackApiDeployment}. + * @param error Error, if any + * @param [response] ApiDeployment + */ + type RollbackApiDeploymentCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiDeployment) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApiDeploymentRevision}. + * @param error Error, if any + * @param [response] ApiDeployment + */ + type DeleteApiDeploymentRevisionCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ApiDeployment) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listArtifacts}. + * @param error Error, if any + * @param [response] ListArtifactsResponse + */ + type ListArtifactsCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.ListArtifactsResponse) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getArtifact}. + * @param error Error, if any + * @param [response] Artifact + */ + type GetArtifactCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.Artifact) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getArtifactContents}. + * @param error Error, if any + * @param [response] HttpBody + */ + type GetArtifactContentsCallback = (error: (Error|null), response?: google.api.HttpBody) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|createArtifact}. + * @param error Error, if any + * @param [response] Artifact + */ + type CreateArtifactCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.Artifact) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|replaceArtifact}. + * @param error Error, if any + * @param [response] Artifact + */ + type ReplaceArtifactCallback = (error: (Error|null), response?: google.cloud.apigeeregistry.v1.Artifact) => void; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteArtifact}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteArtifactCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a ListApisRequest. */ + interface IListApisRequest { + + /** ListApisRequest parent */ + parent?: (string|null); + + /** ListApisRequest pageSize */ + pageSize?: (number|null); + + /** ListApisRequest pageToken */ + pageToken?: (string|null); + + /** ListApisRequest filter */ + filter?: (string|null); + } + + /** Represents a ListApisRequest. */ + class ListApisRequest implements IListApisRequest { + + /** + * Constructs a new ListApisRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApisRequest); + + /** ListApisRequest parent. */ + public parent: string; + + /** ListApisRequest pageSize. */ + public pageSize: number; + + /** ListApisRequest pageToken. */ + public pageToken: string; + + /** ListApisRequest filter. */ + public filter: string; + + /** + * Creates a new ListApisRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApisRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApisRequest): google.cloud.apigeeregistry.v1.ListApisRequest; + + /** + * Encodes the specified ListApisRequest message. Does not implicitly {@link google.cloud.apigeeregistry.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.apigeeregistry.v1.IListApisRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApisRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.v1.IListApisResponse); + + /** ListApisResponse apis. */ + public apis: google.cloud.apigeeregistry.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.apigeeregistry.v1.IListApisResponse): google.cloud.apigeeregistry.v1.ListApisResponse; + + /** + * Encodes the specified ListApisResponse message. Does not implicitly {@link google.cloud.apigeeregistry.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.apigeeregistry.v1.IListApisResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApisResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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 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.apigeeregistry.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.apigeeregistry.v1.IGetApiRequest): google.cloud.apigeeregistry.v1.GetApiRequest; + + /** + * Encodes the specified GetApiRequest message. Does not implicitly {@link google.cloud.apigeeregistry.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.apigeeregistry.v1.IGetApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetApiRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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 a CreateApiRequest. */ + interface ICreateApiRequest { + + /** CreateApiRequest parent */ + parent?: (string|null); + + /** CreateApiRequest api */ + api?: (google.cloud.apigeeregistry.v1.IApi|null); + + /** CreateApiRequest apiId */ + apiId?: (string|null); + } + + /** Represents a CreateApiRequest. */ + class CreateApiRequest implements ICreateApiRequest { + + /** + * Constructs a new CreateApiRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.ICreateApiRequest); + + /** CreateApiRequest parent. */ + public parent: string; + + /** CreateApiRequest api. */ + public api?: (google.cloud.apigeeregistry.v1.IApi|null); + + /** CreateApiRequest apiId. */ + public apiId: string; + + /** + * Creates a new CreateApiRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateApiRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.ICreateApiRequest): google.cloud.apigeeregistry.v1.CreateApiRequest; + + /** + * Encodes the specified CreateApiRequest message. Does not implicitly {@link google.cloud.apigeeregistry.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.apigeeregistry.v1.ICreateApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateApiRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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 an UpdateApiRequest. */ + interface IUpdateApiRequest { + + /** UpdateApiRequest api */ + api?: (google.cloud.apigeeregistry.v1.IApi|null); + + /** UpdateApiRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateApiRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateApiRequest. */ + class UpdateApiRequest implements IUpdateApiRequest { + + /** + * Constructs a new UpdateApiRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IUpdateApiRequest); + + /** UpdateApiRequest api. */ + public api?: (google.cloud.apigeeregistry.v1.IApi|null); + + /** UpdateApiRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateApiRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateApiRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateApiRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IUpdateApiRequest): google.cloud.apigeeregistry.v1.UpdateApiRequest; + + /** + * Encodes the specified UpdateApiRequest message. Does not implicitly {@link google.cloud.apigeeregistry.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.apigeeregistry.v1.IUpdateApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateApiRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.v1.IDeleteApiRequest): google.cloud.apigeeregistry.v1.DeleteApiRequest; + + /** + * Encodes the specified DeleteApiRequest message. Does not implicitly {@link google.cloud.apigeeregistry.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.apigeeregistry.v1.IDeleteApiRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteApiRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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 ListApiVersionsRequest. */ + interface IListApiVersionsRequest { + + /** ListApiVersionsRequest parent */ + parent?: (string|null); + + /** ListApiVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListApiVersionsRequest pageToken */ + pageToken?: (string|null); + + /** ListApiVersionsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListApiVersionsRequest. */ + class ListApiVersionsRequest implements IListApiVersionsRequest { + + /** + * Constructs a new ListApiVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApiVersionsRequest); + + /** ListApiVersionsRequest parent. */ + public parent: string; + + /** ListApiVersionsRequest pageSize. */ + public pageSize: number; + + /** ListApiVersionsRequest pageToken. */ + public pageToken: string; + + /** ListApiVersionsRequest filter. */ + public filter: string; + + /** + * Creates a new ListApiVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiVersionsRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApiVersionsRequest): google.cloud.apigeeregistry.v1.ListApiVersionsRequest; + + /** + * Encodes the specified ListApiVersionsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiVersionsRequest.verify|verify} messages. + * @param message ListApiVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListApiVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiVersionsRequest.verify|verify} messages. + * @param message ListApiVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListApiVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.ListApiVersionsRequest; + + /** + * Decodes a ListApiVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.ListApiVersionsRequest; + + /** + * Verifies a ListApiVersionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListApiVersionsRequest; + + /** + * Creates a plain object from a ListApiVersionsRequest message. Also converts values to other types if specified. + * @param message ListApiVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListApiVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiVersionsResponse. */ + interface IListApiVersionsResponse { + + /** ListApiVersionsResponse apiVersions */ + apiVersions?: (google.cloud.apigeeregistry.v1.IApiVersion[]|null); + + /** ListApiVersionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListApiVersionsResponse. */ + class ListApiVersionsResponse implements IListApiVersionsResponse { + + /** + * Constructs a new ListApiVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApiVersionsResponse); + + /** ListApiVersionsResponse apiVersions. */ + public apiVersions: google.cloud.apigeeregistry.v1.IApiVersion[]; + + /** ListApiVersionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListApiVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiVersionsResponse instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApiVersionsResponse): google.cloud.apigeeregistry.v1.ListApiVersionsResponse; + + /** + * Encodes the specified ListApiVersionsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiVersionsResponse.verify|verify} messages. + * @param message ListApiVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListApiVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiVersionsResponse.verify|verify} messages. + * @param message ListApiVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListApiVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.ListApiVersionsResponse; + + /** + * Decodes a ListApiVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.ListApiVersionsResponse; + + /** + * Verifies a ListApiVersionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListApiVersionsResponse; + + /** + * Creates a plain object from a ListApiVersionsResponse message. Also converts values to other types if specified. + * @param message ListApiVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListApiVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetApiVersionRequest. */ + interface IGetApiVersionRequest { + + /** GetApiVersionRequest name */ + name?: (string|null); + } + + /** Represents a GetApiVersionRequest. */ + class GetApiVersionRequest implements IGetApiVersionRequest { + + /** + * Constructs a new GetApiVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IGetApiVersionRequest); + + /** GetApiVersionRequest name. */ + public name: string; + + /** + * Creates a new GetApiVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetApiVersionRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IGetApiVersionRequest): google.cloud.apigeeregistry.v1.GetApiVersionRequest; + + /** + * Encodes the specified GetApiVersionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiVersionRequest.verify|verify} messages. + * @param message GetApiVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IGetApiVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetApiVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiVersionRequest.verify|verify} messages. + * @param message GetApiVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IGetApiVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetApiVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.GetApiVersionRequest; + + /** + * Decodes a GetApiVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.GetApiVersionRequest; + + /** + * Verifies a GetApiVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetApiVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetApiVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.GetApiVersionRequest; + + /** + * Creates a plain object from a GetApiVersionRequest message. Also converts values to other types if specified. + * @param message GetApiVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.GetApiVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetApiVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetApiVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateApiVersionRequest. */ + interface ICreateApiVersionRequest { + + /** CreateApiVersionRequest parent */ + parent?: (string|null); + + /** CreateApiVersionRequest apiVersion */ + apiVersion?: (google.cloud.apigeeregistry.v1.IApiVersion|null); + + /** CreateApiVersionRequest apiVersionId */ + apiVersionId?: (string|null); + } + + /** Represents a CreateApiVersionRequest. */ + class CreateApiVersionRequest implements ICreateApiVersionRequest { + + /** + * Constructs a new CreateApiVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.ICreateApiVersionRequest); + + /** CreateApiVersionRequest parent. */ + public parent: string; + + /** CreateApiVersionRequest apiVersion. */ + public apiVersion?: (google.cloud.apigeeregistry.v1.IApiVersion|null); + + /** CreateApiVersionRequest apiVersionId. */ + public apiVersionId: string; + + /** + * Creates a new CreateApiVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateApiVersionRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.ICreateApiVersionRequest): google.cloud.apigeeregistry.v1.CreateApiVersionRequest; + + /** + * Encodes the specified CreateApiVersionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiVersionRequest.verify|verify} messages. + * @param message CreateApiVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.ICreateApiVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateApiVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiVersionRequest.verify|verify} messages. + * @param message CreateApiVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.ICreateApiVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateApiVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.CreateApiVersionRequest; + + /** + * Decodes a CreateApiVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.CreateApiVersionRequest; + + /** + * Verifies a CreateApiVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateApiVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateApiVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.CreateApiVersionRequest; + + /** + * Creates a plain object from a CreateApiVersionRequest message. Also converts values to other types if specified. + * @param message CreateApiVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.CreateApiVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateApiVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateApiVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateApiVersionRequest. */ + interface IUpdateApiVersionRequest { + + /** UpdateApiVersionRequest apiVersion */ + apiVersion?: (google.cloud.apigeeregistry.v1.IApiVersion|null); + + /** UpdateApiVersionRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateApiVersionRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateApiVersionRequest. */ + class UpdateApiVersionRequest implements IUpdateApiVersionRequest { + + /** + * Constructs a new UpdateApiVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest); + + /** UpdateApiVersionRequest apiVersion. */ + public apiVersion?: (google.cloud.apigeeregistry.v1.IApiVersion|null); + + /** UpdateApiVersionRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateApiVersionRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateApiVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateApiVersionRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest): google.cloud.apigeeregistry.v1.UpdateApiVersionRequest; + + /** + * Encodes the specified UpdateApiVersionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiVersionRequest.verify|verify} messages. + * @param message UpdateApiVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateApiVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiVersionRequest.verify|verify} messages. + * @param message UpdateApiVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateApiVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.UpdateApiVersionRequest; + + /** + * Decodes an UpdateApiVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.UpdateApiVersionRequest; + + /** + * Verifies an UpdateApiVersionRequest message. + * @param message Plain 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 UpdateApiVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateApiVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.UpdateApiVersionRequest; + + /** + * Creates a plain object from an UpdateApiVersionRequest message. Also converts values to other types if specified. + * @param message UpdateApiVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.UpdateApiVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateApiVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateApiVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteApiVersionRequest. */ + interface IDeleteApiVersionRequest { + + /** DeleteApiVersionRequest name */ + name?: (string|null); + + /** DeleteApiVersionRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteApiVersionRequest. */ + class DeleteApiVersionRequest implements IDeleteApiVersionRequest { + + /** + * Constructs a new DeleteApiVersionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest); + + /** DeleteApiVersionRequest name. */ + public name: string; + + /** DeleteApiVersionRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteApiVersionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteApiVersionRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest): google.cloud.apigeeregistry.v1.DeleteApiVersionRequest; + + /** + * Encodes the specified DeleteApiVersionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiVersionRequest.verify|verify} messages. + * @param message DeleteApiVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteApiVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiVersionRequest.verify|verify} messages. + * @param message DeleteApiVersionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteApiVersionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.DeleteApiVersionRequest; + + /** + * Decodes a DeleteApiVersionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.DeleteApiVersionRequest; + + /** + * Verifies a DeleteApiVersionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteApiVersionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteApiVersionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.DeleteApiVersionRequest; + + /** + * Creates a plain object from a DeleteApiVersionRequest message. Also converts values to other types if specified. + * @param message DeleteApiVersionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.DeleteApiVersionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteApiVersionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteApiVersionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiSpecsRequest. */ + interface IListApiSpecsRequest { + + /** ListApiSpecsRequest parent */ + parent?: (string|null); + + /** ListApiSpecsRequest pageSize */ + pageSize?: (number|null); + + /** ListApiSpecsRequest pageToken */ + pageToken?: (string|null); + + /** ListApiSpecsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListApiSpecsRequest. */ + class ListApiSpecsRequest implements IListApiSpecsRequest { + + /** + * Constructs a new ListApiSpecsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApiSpecsRequest); + + /** ListApiSpecsRequest parent. */ + public parent: string; + + /** ListApiSpecsRequest pageSize. */ + public pageSize: number; + + /** ListApiSpecsRequest pageToken. */ + public pageToken: string; + + /** ListApiSpecsRequest filter. */ + public filter: string; + + /** + * Creates a new ListApiSpecsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiSpecsRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApiSpecsRequest): google.cloud.apigeeregistry.v1.ListApiSpecsRequest; + + /** + * Encodes the specified ListApiSpecsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecsRequest.verify|verify} messages. + * @param message ListApiSpecsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListApiSpecsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiSpecsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecsRequest.verify|verify} messages. + * @param message ListApiSpecsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListApiSpecsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiSpecsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiSpecsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.ListApiSpecsRequest; + + /** + * Decodes a ListApiSpecsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiSpecsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.ListApiSpecsRequest; + + /** + * Verifies a ListApiSpecsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiSpecsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiSpecsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListApiSpecsRequest; + + /** + * Creates a plain object from a ListApiSpecsRequest message. Also converts values to other types if specified. + * @param message ListApiSpecsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListApiSpecsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiSpecsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiSpecsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiSpecsResponse. */ + interface IListApiSpecsResponse { + + /** ListApiSpecsResponse apiSpecs */ + apiSpecs?: (google.cloud.apigeeregistry.v1.IApiSpec[]|null); + + /** ListApiSpecsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListApiSpecsResponse. */ + class ListApiSpecsResponse implements IListApiSpecsResponse { + + /** + * Constructs a new ListApiSpecsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApiSpecsResponse); + + /** ListApiSpecsResponse apiSpecs. */ + public apiSpecs: google.cloud.apigeeregistry.v1.IApiSpec[]; + + /** ListApiSpecsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListApiSpecsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiSpecsResponse instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApiSpecsResponse): google.cloud.apigeeregistry.v1.ListApiSpecsResponse; + + /** + * Encodes the specified ListApiSpecsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecsResponse.verify|verify} messages. + * @param message ListApiSpecsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListApiSpecsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiSpecsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecsResponse.verify|verify} messages. + * @param message ListApiSpecsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListApiSpecsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiSpecsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiSpecsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.ListApiSpecsResponse; + + /** + * Decodes a ListApiSpecsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiSpecsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.ListApiSpecsResponse; + + /** + * Verifies a ListApiSpecsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiSpecsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiSpecsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListApiSpecsResponse; + + /** + * Creates a plain object from a ListApiSpecsResponse message. Also converts values to other types if specified. + * @param message ListApiSpecsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListApiSpecsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiSpecsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiSpecsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetApiSpecRequest. */ + interface IGetApiSpecRequest { + + /** GetApiSpecRequest name */ + name?: (string|null); + } + + /** Represents a GetApiSpecRequest. */ + class GetApiSpecRequest implements IGetApiSpecRequest { + + /** + * Constructs a new GetApiSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IGetApiSpecRequest); + + /** GetApiSpecRequest name. */ + public name: string; + + /** + * Creates a new GetApiSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetApiSpecRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IGetApiSpecRequest): google.cloud.apigeeregistry.v1.GetApiSpecRequest; + + /** + * Encodes the specified GetApiSpecRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiSpecRequest.verify|verify} messages. + * @param message GetApiSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IGetApiSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetApiSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiSpecRequest.verify|verify} messages. + * @param message GetApiSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IGetApiSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetApiSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.GetApiSpecRequest; + + /** + * Decodes a GetApiSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.GetApiSpecRequest; + + /** + * Verifies a GetApiSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetApiSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetApiSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.GetApiSpecRequest; + + /** + * Creates a plain object from a GetApiSpecRequest message. Also converts values to other types if specified. + * @param message GetApiSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.GetApiSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetApiSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetApiSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetApiSpecContentsRequest. */ + interface IGetApiSpecContentsRequest { + + /** GetApiSpecContentsRequest name */ + name?: (string|null); + } + + /** Represents a GetApiSpecContentsRequest. */ + class GetApiSpecContentsRequest implements IGetApiSpecContentsRequest { + + /** + * Constructs a new GetApiSpecContentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest); + + /** GetApiSpecContentsRequest name. */ + public name: string; + + /** + * Creates a new GetApiSpecContentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetApiSpecContentsRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest): google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest; + + /** + * Encodes the specified GetApiSpecContentsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest.verify|verify} messages. + * @param message GetApiSpecContentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetApiSpecContentsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest.verify|verify} messages. + * @param message GetApiSpecContentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetApiSpecContentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetApiSpecContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest; + + /** + * Decodes a GetApiSpecContentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetApiSpecContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest; + + /** + * Verifies a GetApiSpecContentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetApiSpecContentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetApiSpecContentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest; + + /** + * Creates a plain object from a GetApiSpecContentsRequest message. Also converts values to other types if specified. + * @param message GetApiSpecContentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetApiSpecContentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetApiSpecContentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateApiSpecRequest. */ + interface ICreateApiSpecRequest { + + /** CreateApiSpecRequest parent */ + parent?: (string|null); + + /** CreateApiSpecRequest apiSpec */ + apiSpec?: (google.cloud.apigeeregistry.v1.IApiSpec|null); + + /** CreateApiSpecRequest apiSpecId */ + apiSpecId?: (string|null); + } + + /** Represents a CreateApiSpecRequest. */ + class CreateApiSpecRequest implements ICreateApiSpecRequest { + + /** + * Constructs a new CreateApiSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.ICreateApiSpecRequest); + + /** CreateApiSpecRequest parent. */ + public parent: string; + + /** CreateApiSpecRequest apiSpec. */ + public apiSpec?: (google.cloud.apigeeregistry.v1.IApiSpec|null); + + /** CreateApiSpecRequest apiSpecId. */ + public apiSpecId: string; + + /** + * Creates a new CreateApiSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateApiSpecRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.ICreateApiSpecRequest): google.cloud.apigeeregistry.v1.CreateApiSpecRequest; + + /** + * Encodes the specified CreateApiSpecRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiSpecRequest.verify|verify} messages. + * @param message CreateApiSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.ICreateApiSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateApiSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiSpecRequest.verify|verify} messages. + * @param message CreateApiSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.ICreateApiSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateApiSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.CreateApiSpecRequest; + + /** + * Decodes a CreateApiSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.CreateApiSpecRequest; + + /** + * Verifies a CreateApiSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateApiSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateApiSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.CreateApiSpecRequest; + + /** + * Creates a plain object from a CreateApiSpecRequest message. Also converts values to other types if specified. + * @param message CreateApiSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.CreateApiSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateApiSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateApiSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateApiSpecRequest. */ + interface IUpdateApiSpecRequest { + + /** UpdateApiSpecRequest apiSpec */ + apiSpec?: (google.cloud.apigeeregistry.v1.IApiSpec|null); + + /** UpdateApiSpecRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateApiSpecRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateApiSpecRequest. */ + class UpdateApiSpecRequest implements IUpdateApiSpecRequest { + + /** + * Constructs a new UpdateApiSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest); + + /** UpdateApiSpecRequest apiSpec. */ + public apiSpec?: (google.cloud.apigeeregistry.v1.IApiSpec|null); + + /** UpdateApiSpecRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateApiSpecRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateApiSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateApiSpecRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest): google.cloud.apigeeregistry.v1.UpdateApiSpecRequest; + + /** + * Encodes the specified UpdateApiSpecRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiSpecRequest.verify|verify} messages. + * @param message UpdateApiSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateApiSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiSpecRequest.verify|verify} messages. + * @param message UpdateApiSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateApiSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.UpdateApiSpecRequest; + + /** + * Decodes an UpdateApiSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.UpdateApiSpecRequest; + + /** + * Verifies an UpdateApiSpecRequest message. + * @param message Plain 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 UpdateApiSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateApiSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.UpdateApiSpecRequest; + + /** + * Creates a plain object from an UpdateApiSpecRequest message. Also converts values to other types if specified. + * @param message UpdateApiSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.UpdateApiSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateApiSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateApiSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteApiSpecRequest. */ + interface IDeleteApiSpecRequest { + + /** DeleteApiSpecRequest name */ + name?: (string|null); + + /** DeleteApiSpecRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteApiSpecRequest. */ + class DeleteApiSpecRequest implements IDeleteApiSpecRequest { + + /** + * Constructs a new DeleteApiSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest); + + /** DeleteApiSpecRequest name. */ + public name: string; + + /** DeleteApiSpecRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteApiSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteApiSpecRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest): google.cloud.apigeeregistry.v1.DeleteApiSpecRequest; + + /** + * Encodes the specified DeleteApiSpecRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiSpecRequest.verify|verify} messages. + * @param message DeleteApiSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteApiSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiSpecRequest.verify|verify} messages. + * @param message DeleteApiSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteApiSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.DeleteApiSpecRequest; + + /** + * Decodes a DeleteApiSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.DeleteApiSpecRequest; + + /** + * Verifies a DeleteApiSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteApiSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteApiSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.DeleteApiSpecRequest; + + /** + * Creates a plain object from a DeleteApiSpecRequest message. Also converts values to other types if specified. + * @param message DeleteApiSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.DeleteApiSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteApiSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteApiSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TagApiSpecRevisionRequest. */ + interface ITagApiSpecRevisionRequest { + + /** TagApiSpecRevisionRequest name */ + name?: (string|null); + + /** TagApiSpecRevisionRequest tag */ + tag?: (string|null); + } + + /** Represents a TagApiSpecRevisionRequest. */ + class TagApiSpecRevisionRequest implements ITagApiSpecRevisionRequest { + + /** + * Constructs a new TagApiSpecRevisionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest); + + /** TagApiSpecRevisionRequest name. */ + public name: string; + + /** TagApiSpecRevisionRequest tag. */ + public tag: string; + + /** + * Creates a new TagApiSpecRevisionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TagApiSpecRevisionRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest): google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest; + + /** + * Encodes the specified TagApiSpecRevisionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest.verify|verify} messages. + * @param message TagApiSpecRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TagApiSpecRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest.verify|verify} messages. + * @param message TagApiSpecRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TagApiSpecRevisionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TagApiSpecRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest; + + /** + * Decodes a TagApiSpecRevisionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TagApiSpecRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest; + + /** + * Verifies a TagApiSpecRevisionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TagApiSpecRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TagApiSpecRevisionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest; + + /** + * Creates a plain object from a TagApiSpecRevisionRequest message. Also converts values to other types if specified. + * @param message TagApiSpecRevisionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TagApiSpecRevisionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TagApiSpecRevisionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiSpecRevisionsRequest. */ + interface IListApiSpecRevisionsRequest { + + /** ListApiSpecRevisionsRequest name */ + name?: (string|null); + + /** ListApiSpecRevisionsRequest pageSize */ + pageSize?: (number|null); + + /** ListApiSpecRevisionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListApiSpecRevisionsRequest. */ + class ListApiSpecRevisionsRequest implements IListApiSpecRevisionsRequest { + + /** + * Constructs a new ListApiSpecRevisionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest); + + /** ListApiSpecRevisionsRequest name. */ + public name: string; + + /** ListApiSpecRevisionsRequest pageSize. */ + public pageSize: number; + + /** ListApiSpecRevisionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListApiSpecRevisionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiSpecRevisionsRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest): google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest; + + /** + * Encodes the specified ListApiSpecRevisionsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest.verify|verify} messages. + * @param message ListApiSpecRevisionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiSpecRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest.verify|verify} messages. + * @param message ListApiSpecRevisionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiSpecRevisionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiSpecRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest; + + /** + * Decodes a ListApiSpecRevisionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiSpecRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest; + + /** + * Verifies a ListApiSpecRevisionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiSpecRevisionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiSpecRevisionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest; + + /** + * Creates a plain object from a ListApiSpecRevisionsRequest message. Also converts values to other types if specified. + * @param message ListApiSpecRevisionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiSpecRevisionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiSpecRevisionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiSpecRevisionsResponse. */ + interface IListApiSpecRevisionsResponse { + + /** ListApiSpecRevisionsResponse apiSpecs */ + apiSpecs?: (google.cloud.apigeeregistry.v1.IApiSpec[]|null); + + /** ListApiSpecRevisionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListApiSpecRevisionsResponse. */ + class ListApiSpecRevisionsResponse implements IListApiSpecRevisionsResponse { + + /** + * Constructs a new ListApiSpecRevisionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse); + + /** ListApiSpecRevisionsResponse apiSpecs. */ + public apiSpecs: google.cloud.apigeeregistry.v1.IApiSpec[]; + + /** ListApiSpecRevisionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListApiSpecRevisionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiSpecRevisionsResponse instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse): google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse; + + /** + * Encodes the specified ListApiSpecRevisionsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse.verify|verify} messages. + * @param message ListApiSpecRevisionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiSpecRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse.verify|verify} messages. + * @param message ListApiSpecRevisionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiSpecRevisionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiSpecRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse; + + /** + * Decodes a ListApiSpecRevisionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiSpecRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse; + + /** + * Verifies a ListApiSpecRevisionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiSpecRevisionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiSpecRevisionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse; + + /** + * Creates a plain object from a ListApiSpecRevisionsResponse message. Also converts values to other types if specified. + * @param message ListApiSpecRevisionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiSpecRevisionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiSpecRevisionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RollbackApiSpecRequest. */ + interface IRollbackApiSpecRequest { + + /** RollbackApiSpecRequest name */ + name?: (string|null); + + /** RollbackApiSpecRequest revisionId */ + revisionId?: (string|null); + } + + /** Represents a RollbackApiSpecRequest. */ + class RollbackApiSpecRequest implements IRollbackApiSpecRequest { + + /** + * Constructs a new RollbackApiSpecRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest); + + /** RollbackApiSpecRequest name. */ + public name: string; + + /** RollbackApiSpecRequest revisionId. */ + public revisionId: string; + + /** + * Creates a new RollbackApiSpecRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RollbackApiSpecRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest): google.cloud.apigeeregistry.v1.RollbackApiSpecRequest; + + /** + * Encodes the specified RollbackApiSpecRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.RollbackApiSpecRequest.verify|verify} messages. + * @param message RollbackApiSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RollbackApiSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.RollbackApiSpecRequest.verify|verify} messages. + * @param message RollbackApiSpecRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RollbackApiSpecRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RollbackApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.RollbackApiSpecRequest; + + /** + * Decodes a RollbackApiSpecRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RollbackApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.RollbackApiSpecRequest; + + /** + * Verifies a RollbackApiSpecRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RollbackApiSpecRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RollbackApiSpecRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.RollbackApiSpecRequest; + + /** + * Creates a plain object from a RollbackApiSpecRequest message. Also converts values to other types if specified. + * @param message RollbackApiSpecRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.RollbackApiSpecRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RollbackApiSpecRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RollbackApiSpecRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteApiSpecRevisionRequest. */ + interface IDeleteApiSpecRevisionRequest { + + /** DeleteApiSpecRevisionRequest name */ + name?: (string|null); + } + + /** Represents a DeleteApiSpecRevisionRequest. */ + class DeleteApiSpecRevisionRequest implements IDeleteApiSpecRevisionRequest { + + /** + * Constructs a new DeleteApiSpecRevisionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest); + + /** DeleteApiSpecRevisionRequest name. */ + public name: string; + + /** + * Creates a new DeleteApiSpecRevisionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteApiSpecRevisionRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest): google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest; + + /** + * Encodes the specified DeleteApiSpecRevisionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest.verify|verify} messages. + * @param message DeleteApiSpecRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteApiSpecRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest.verify|verify} messages. + * @param message DeleteApiSpecRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteApiSpecRevisionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteApiSpecRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest; + + /** + * Decodes a DeleteApiSpecRevisionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteApiSpecRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest; + + /** + * Verifies a DeleteApiSpecRevisionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteApiSpecRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteApiSpecRevisionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest; + + /** + * Creates a plain object from a DeleteApiSpecRevisionRequest message. Also converts values to other types if specified. + * @param message DeleteApiSpecRevisionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteApiSpecRevisionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteApiSpecRevisionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiDeploymentsRequest. */ + interface IListApiDeploymentsRequest { + + /** ListApiDeploymentsRequest parent */ + parent?: (string|null); + + /** ListApiDeploymentsRequest pageSize */ + pageSize?: (number|null); + + /** ListApiDeploymentsRequest pageToken */ + pageToken?: (string|null); + + /** ListApiDeploymentsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListApiDeploymentsRequest. */ + class ListApiDeploymentsRequest implements IListApiDeploymentsRequest { + + /** + * Constructs a new ListApiDeploymentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest); + + /** ListApiDeploymentsRequest parent. */ + public parent: string; + + /** ListApiDeploymentsRequest pageSize. */ + public pageSize: number; + + /** ListApiDeploymentsRequest pageToken. */ + public pageToken: string; + + /** ListApiDeploymentsRequest filter. */ + public filter: string; + + /** + * Creates a new ListApiDeploymentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiDeploymentsRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest): google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest; + + /** + * Encodes the specified ListApiDeploymentsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest.verify|verify} messages. + * @param message ListApiDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest.verify|verify} messages. + * @param message ListApiDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiDeploymentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest; + + /** + * Decodes a ListApiDeploymentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest; + + /** + * Verifies a ListApiDeploymentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiDeploymentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest; + + /** + * Creates a plain object from a ListApiDeploymentsRequest message. Also converts values to other types if specified. + * @param message ListApiDeploymentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiDeploymentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiDeploymentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiDeploymentsResponse. */ + interface IListApiDeploymentsResponse { + + /** ListApiDeploymentsResponse apiDeployments */ + apiDeployments?: (google.cloud.apigeeregistry.v1.IApiDeployment[]|null); + + /** ListApiDeploymentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListApiDeploymentsResponse. */ + class ListApiDeploymentsResponse implements IListApiDeploymentsResponse { + + /** + * Constructs a new ListApiDeploymentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse); + + /** ListApiDeploymentsResponse apiDeployments. */ + public apiDeployments: google.cloud.apigeeregistry.v1.IApiDeployment[]; + + /** ListApiDeploymentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListApiDeploymentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiDeploymentsResponse instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse): google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse; + + /** + * Encodes the specified ListApiDeploymentsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse.verify|verify} messages. + * @param message ListApiDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse.verify|verify} messages. + * @param message ListApiDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiDeploymentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse; + + /** + * Decodes a ListApiDeploymentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse; + + /** + * Verifies a ListApiDeploymentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiDeploymentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse; + + /** + * Creates a plain object from a ListApiDeploymentsResponse message. Also converts values to other types if specified. + * @param message ListApiDeploymentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiDeploymentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiDeploymentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetApiDeploymentRequest. */ + interface IGetApiDeploymentRequest { + + /** GetApiDeploymentRequest name */ + name?: (string|null); + } + + /** Represents a GetApiDeploymentRequest. */ + class GetApiDeploymentRequest implements IGetApiDeploymentRequest { + + /** + * Constructs a new GetApiDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest); + + /** GetApiDeploymentRequest name. */ + public name: string; + + /** + * Creates a new GetApiDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetApiDeploymentRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest): google.cloud.apigeeregistry.v1.GetApiDeploymentRequest; + + /** + * Encodes the specified GetApiDeploymentRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiDeploymentRequest.verify|verify} messages. + * @param message GetApiDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetApiDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiDeploymentRequest.verify|verify} messages. + * @param message GetApiDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetApiDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.GetApiDeploymentRequest; + + /** + * Decodes a GetApiDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.GetApiDeploymentRequest; + + /** + * Verifies a GetApiDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetApiDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetApiDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.GetApiDeploymentRequest; + + /** + * Creates a plain object from a GetApiDeploymentRequest message. Also converts values to other types if specified. + * @param message GetApiDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.GetApiDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetApiDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetApiDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateApiDeploymentRequest. */ + interface ICreateApiDeploymentRequest { + + /** CreateApiDeploymentRequest parent */ + parent?: (string|null); + + /** CreateApiDeploymentRequest apiDeployment */ + apiDeployment?: (google.cloud.apigeeregistry.v1.IApiDeployment|null); + + /** CreateApiDeploymentRequest apiDeploymentId */ + apiDeploymentId?: (string|null); + } + + /** Represents a CreateApiDeploymentRequest. */ + class CreateApiDeploymentRequest implements ICreateApiDeploymentRequest { + + /** + * Constructs a new CreateApiDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest); + + /** CreateApiDeploymentRequest parent. */ + public parent: string; + + /** CreateApiDeploymentRequest apiDeployment. */ + public apiDeployment?: (google.cloud.apigeeregistry.v1.IApiDeployment|null); + + /** CreateApiDeploymentRequest apiDeploymentId. */ + public apiDeploymentId: string; + + /** + * Creates a new CreateApiDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateApiDeploymentRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest): google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest; + + /** + * Encodes the specified CreateApiDeploymentRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest.verify|verify} messages. + * @param message CreateApiDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateApiDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest.verify|verify} messages. + * @param message CreateApiDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateApiDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest; + + /** + * Decodes a CreateApiDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest; + + /** + * Verifies a CreateApiDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateApiDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateApiDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest; + + /** + * Creates a plain object from a CreateApiDeploymentRequest message. Also converts values to other types if specified. + * @param message CreateApiDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateApiDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateApiDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateApiDeploymentRequest. */ + interface IUpdateApiDeploymentRequest { + + /** UpdateApiDeploymentRequest apiDeployment */ + apiDeployment?: (google.cloud.apigeeregistry.v1.IApiDeployment|null); + + /** UpdateApiDeploymentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateApiDeploymentRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateApiDeploymentRequest. */ + class UpdateApiDeploymentRequest implements IUpdateApiDeploymentRequest { + + /** + * Constructs a new UpdateApiDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest); + + /** UpdateApiDeploymentRequest apiDeployment. */ + public apiDeployment?: (google.cloud.apigeeregistry.v1.IApiDeployment|null); + + /** UpdateApiDeploymentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateApiDeploymentRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateApiDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateApiDeploymentRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest): google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest; + + /** + * Encodes the specified UpdateApiDeploymentRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest.verify|verify} messages. + * @param message UpdateApiDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateApiDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest.verify|verify} messages. + * @param message UpdateApiDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateApiDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest; + + /** + * Decodes an UpdateApiDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest; + + /** + * Verifies an UpdateApiDeploymentRequest message. + * @param message Plain 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 UpdateApiDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateApiDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest; + + /** + * Creates a plain object from an UpdateApiDeploymentRequest message. Also converts values to other types if specified. + * @param message UpdateApiDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateApiDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateApiDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteApiDeploymentRequest. */ + interface IDeleteApiDeploymentRequest { + + /** DeleteApiDeploymentRequest name */ + name?: (string|null); + + /** DeleteApiDeploymentRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteApiDeploymentRequest. */ + class DeleteApiDeploymentRequest implements IDeleteApiDeploymentRequest { + + /** + * Constructs a new DeleteApiDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest); + + /** DeleteApiDeploymentRequest name. */ + public name: string; + + /** DeleteApiDeploymentRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteApiDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteApiDeploymentRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest): google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest; + + /** + * Encodes the specified DeleteApiDeploymentRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest.verify|verify} messages. + * @param message DeleteApiDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteApiDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest.verify|verify} messages. + * @param message DeleteApiDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteApiDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest; + + /** + * Decodes a DeleteApiDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest; + + /** + * Verifies a DeleteApiDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteApiDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteApiDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest; + + /** + * Creates a plain object from a DeleteApiDeploymentRequest message. Also converts values to other types if specified. + * @param message DeleteApiDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteApiDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteApiDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TagApiDeploymentRevisionRequest. */ + interface ITagApiDeploymentRevisionRequest { + + /** TagApiDeploymentRevisionRequest name */ + name?: (string|null); + + /** TagApiDeploymentRevisionRequest tag */ + tag?: (string|null); + } + + /** Represents a TagApiDeploymentRevisionRequest. */ + class TagApiDeploymentRevisionRequest implements ITagApiDeploymentRevisionRequest { + + /** + * Constructs a new TagApiDeploymentRevisionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest); + + /** TagApiDeploymentRevisionRequest name. */ + public name: string; + + /** TagApiDeploymentRevisionRequest tag. */ + public tag: string; + + /** + * Creates a new TagApiDeploymentRevisionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TagApiDeploymentRevisionRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest): google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest; + + /** + * Encodes the specified TagApiDeploymentRevisionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest.verify|verify} messages. + * @param message TagApiDeploymentRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TagApiDeploymentRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest.verify|verify} messages. + * @param message TagApiDeploymentRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TagApiDeploymentRevisionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TagApiDeploymentRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest; + + /** + * Decodes a TagApiDeploymentRevisionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TagApiDeploymentRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest; + + /** + * Verifies a TagApiDeploymentRevisionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TagApiDeploymentRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TagApiDeploymentRevisionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest; + + /** + * Creates a plain object from a TagApiDeploymentRevisionRequest message. Also converts values to other types if specified. + * @param message TagApiDeploymentRevisionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TagApiDeploymentRevisionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TagApiDeploymentRevisionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiDeploymentRevisionsRequest. */ + interface IListApiDeploymentRevisionsRequest { + + /** ListApiDeploymentRevisionsRequest name */ + name?: (string|null); + + /** ListApiDeploymentRevisionsRequest pageSize */ + pageSize?: (number|null); + + /** ListApiDeploymentRevisionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListApiDeploymentRevisionsRequest. */ + class ListApiDeploymentRevisionsRequest implements IListApiDeploymentRevisionsRequest { + + /** + * Constructs a new ListApiDeploymentRevisionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest); + + /** ListApiDeploymentRevisionsRequest name. */ + public name: string; + + /** ListApiDeploymentRevisionsRequest pageSize. */ + public pageSize: number; + + /** ListApiDeploymentRevisionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListApiDeploymentRevisionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiDeploymentRevisionsRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest): google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest; + + /** + * Encodes the specified ListApiDeploymentRevisionsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest.verify|verify} messages. + * @param message ListApiDeploymentRevisionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiDeploymentRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest.verify|verify} messages. + * @param message ListApiDeploymentRevisionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiDeploymentRevisionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiDeploymentRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest; + + /** + * Decodes a ListApiDeploymentRevisionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiDeploymentRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest; + + /** + * Verifies a ListApiDeploymentRevisionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiDeploymentRevisionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiDeploymentRevisionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest; + + /** + * Creates a plain object from a ListApiDeploymentRevisionsRequest message. Also converts values to other types if specified. + * @param message ListApiDeploymentRevisionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiDeploymentRevisionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiDeploymentRevisionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListApiDeploymentRevisionsResponse. */ + interface IListApiDeploymentRevisionsResponse { + + /** ListApiDeploymentRevisionsResponse apiDeployments */ + apiDeployments?: (google.cloud.apigeeregistry.v1.IApiDeployment[]|null); + + /** ListApiDeploymentRevisionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListApiDeploymentRevisionsResponse. */ + class ListApiDeploymentRevisionsResponse implements IListApiDeploymentRevisionsResponse { + + /** + * Constructs a new ListApiDeploymentRevisionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse); + + /** ListApiDeploymentRevisionsResponse apiDeployments. */ + public apiDeployments: google.cloud.apigeeregistry.v1.IApiDeployment[]; + + /** ListApiDeploymentRevisionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListApiDeploymentRevisionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListApiDeploymentRevisionsResponse instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse): google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse; + + /** + * Encodes the specified ListApiDeploymentRevisionsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse.verify|verify} messages. + * @param message ListApiDeploymentRevisionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListApiDeploymentRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse.verify|verify} messages. + * @param message ListApiDeploymentRevisionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListApiDeploymentRevisionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListApiDeploymentRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse; + + /** + * Decodes a ListApiDeploymentRevisionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListApiDeploymentRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse; + + /** + * Verifies a ListApiDeploymentRevisionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListApiDeploymentRevisionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListApiDeploymentRevisionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse; + + /** + * Creates a plain object from a ListApiDeploymentRevisionsResponse message. Also converts values to other types if specified. + * @param message ListApiDeploymentRevisionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListApiDeploymentRevisionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListApiDeploymentRevisionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RollbackApiDeploymentRequest. */ + interface IRollbackApiDeploymentRequest { + + /** RollbackApiDeploymentRequest name */ + name?: (string|null); + + /** RollbackApiDeploymentRequest revisionId */ + revisionId?: (string|null); + } + + /** Represents a RollbackApiDeploymentRequest. */ + class RollbackApiDeploymentRequest implements IRollbackApiDeploymentRequest { + + /** + * Constructs a new RollbackApiDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest); + + /** RollbackApiDeploymentRequest name. */ + public name: string; + + /** RollbackApiDeploymentRequest revisionId. */ + public revisionId: string; + + /** + * Creates a new RollbackApiDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RollbackApiDeploymentRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest): google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest; + + /** + * Encodes the specified RollbackApiDeploymentRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest.verify|verify} messages. + * @param message RollbackApiDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RollbackApiDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest.verify|verify} messages. + * @param message RollbackApiDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RollbackApiDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RollbackApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest; + + /** + * Decodes a RollbackApiDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RollbackApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest; + + /** + * Verifies a RollbackApiDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RollbackApiDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RollbackApiDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest; + + /** + * Creates a plain object from a RollbackApiDeploymentRequest message. Also converts values to other types if specified. + * @param message RollbackApiDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RollbackApiDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RollbackApiDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteApiDeploymentRevisionRequest. */ + interface IDeleteApiDeploymentRevisionRequest { + + /** DeleteApiDeploymentRevisionRequest name */ + name?: (string|null); + } + + /** Represents a DeleteApiDeploymentRevisionRequest. */ + class DeleteApiDeploymentRevisionRequest implements IDeleteApiDeploymentRevisionRequest { + + /** + * Constructs a new DeleteApiDeploymentRevisionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest); + + /** DeleteApiDeploymentRevisionRequest name. */ + public name: string; + + /** + * Creates a new DeleteApiDeploymentRevisionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteApiDeploymentRevisionRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest): google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest; + + /** + * Encodes the specified DeleteApiDeploymentRevisionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest.verify|verify} messages. + * @param message DeleteApiDeploymentRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteApiDeploymentRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest.verify|verify} messages. + * @param message DeleteApiDeploymentRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteApiDeploymentRevisionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteApiDeploymentRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest; + + /** + * Decodes a DeleteApiDeploymentRevisionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteApiDeploymentRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest; + + /** + * Verifies a DeleteApiDeploymentRevisionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteApiDeploymentRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteApiDeploymentRevisionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest; + + /** + * Creates a plain object from a DeleteApiDeploymentRevisionRequest message. Also converts values to other types if specified. + * @param message DeleteApiDeploymentRevisionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteApiDeploymentRevisionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteApiDeploymentRevisionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListArtifactsRequest. */ + interface IListArtifactsRequest { + + /** ListArtifactsRequest parent */ + parent?: (string|null); + + /** ListArtifactsRequest pageSize */ + pageSize?: (number|null); + + /** ListArtifactsRequest pageToken */ + pageToken?: (string|null); + + /** ListArtifactsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListArtifactsRequest. */ + class ListArtifactsRequest implements IListArtifactsRequest { + + /** + * Constructs a new ListArtifactsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListArtifactsRequest); + + /** ListArtifactsRequest parent. */ + public parent: string; + + /** ListArtifactsRequest pageSize. */ + public pageSize: number; + + /** ListArtifactsRequest pageToken. */ + public pageToken: string; + + /** ListArtifactsRequest filter. */ + public filter: string; + + /** + * Creates a new ListArtifactsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListArtifactsRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListArtifactsRequest): google.cloud.apigeeregistry.v1.ListArtifactsRequest; + + /** + * Encodes the specified ListArtifactsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListArtifactsRequest.verify|verify} messages. + * @param message ListArtifactsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListArtifactsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListArtifactsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListArtifactsRequest.verify|verify} messages. + * @param message ListArtifactsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListArtifactsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListArtifactsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListArtifactsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.ListArtifactsRequest; + + /** + * Decodes a ListArtifactsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListArtifactsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.ListArtifactsRequest; + + /** + * Verifies a ListArtifactsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListArtifactsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListArtifactsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListArtifactsRequest; + + /** + * Creates a plain object from a ListArtifactsRequest message. Also converts values to other types if specified. + * @param message ListArtifactsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListArtifactsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListArtifactsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListArtifactsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListArtifactsResponse. */ + interface IListArtifactsResponse { + + /** ListArtifactsResponse artifacts */ + artifacts?: (google.cloud.apigeeregistry.v1.IArtifact[]|null); + + /** ListArtifactsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListArtifactsResponse. */ + class ListArtifactsResponse implements IListArtifactsResponse { + + /** + * Constructs a new ListArtifactsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IListArtifactsResponse); + + /** ListArtifactsResponse artifacts. */ + public artifacts: google.cloud.apigeeregistry.v1.IArtifact[]; + + /** ListArtifactsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListArtifactsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListArtifactsResponse instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IListArtifactsResponse): google.cloud.apigeeregistry.v1.ListArtifactsResponse; + + /** + * Encodes the specified ListArtifactsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListArtifactsResponse.verify|verify} messages. + * @param message ListArtifactsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IListArtifactsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListArtifactsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListArtifactsResponse.verify|verify} messages. + * @param message ListArtifactsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IListArtifactsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListArtifactsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListArtifactsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.ListArtifactsResponse; + + /** + * Decodes a ListArtifactsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListArtifactsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.ListArtifactsResponse; + + /** + * Verifies a ListArtifactsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListArtifactsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListArtifactsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ListArtifactsResponse; + + /** + * Creates a plain object from a ListArtifactsResponse message. Also converts values to other types if specified. + * @param message ListArtifactsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ListArtifactsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListArtifactsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListArtifactsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetArtifactRequest. */ + interface IGetArtifactRequest { + + /** GetArtifactRequest name */ + name?: (string|null); + } + + /** Represents a GetArtifactRequest. */ + class GetArtifactRequest implements IGetArtifactRequest { + + /** + * Constructs a new GetArtifactRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IGetArtifactRequest); + + /** GetArtifactRequest name. */ + public name: string; + + /** + * Creates a new GetArtifactRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetArtifactRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IGetArtifactRequest): google.cloud.apigeeregistry.v1.GetArtifactRequest; + + /** + * Encodes the specified GetArtifactRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetArtifactRequest.verify|verify} messages. + * @param message GetArtifactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IGetArtifactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetArtifactRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetArtifactRequest.verify|verify} messages. + * @param message GetArtifactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IGetArtifactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetArtifactRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.GetArtifactRequest; + + /** + * Decodes a GetArtifactRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.GetArtifactRequest; + + /** + * Verifies a GetArtifactRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetArtifactRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetArtifactRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.GetArtifactRequest; + + /** + * Creates a plain object from a GetArtifactRequest message. Also converts values to other types if specified. + * @param message GetArtifactRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.GetArtifactRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetArtifactRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetArtifactRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetArtifactContentsRequest. */ + interface IGetArtifactContentsRequest { + + /** GetArtifactContentsRequest name */ + name?: (string|null); + } + + /** Represents a GetArtifactContentsRequest. */ + class GetArtifactContentsRequest implements IGetArtifactContentsRequest { + + /** + * Constructs a new GetArtifactContentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest); + + /** GetArtifactContentsRequest name. */ + public name: string; + + /** + * Creates a new GetArtifactContentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetArtifactContentsRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest): google.cloud.apigeeregistry.v1.GetArtifactContentsRequest; + + /** + * Encodes the specified GetArtifactContentsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetArtifactContentsRequest.verify|verify} messages. + * @param message GetArtifactContentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetArtifactContentsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetArtifactContentsRequest.verify|verify} messages. + * @param message GetArtifactContentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetArtifactContentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetArtifactContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.GetArtifactContentsRequest; + + /** + * Decodes a GetArtifactContentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetArtifactContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.GetArtifactContentsRequest; + + /** + * Verifies a GetArtifactContentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetArtifactContentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetArtifactContentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.GetArtifactContentsRequest; + + /** + * Creates a plain object from a GetArtifactContentsRequest message. Also converts values to other types if specified. + * @param message GetArtifactContentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.GetArtifactContentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetArtifactContentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetArtifactContentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateArtifactRequest. */ + interface ICreateArtifactRequest { + + /** CreateArtifactRequest parent */ + parent?: (string|null); + + /** CreateArtifactRequest artifact */ + artifact?: (google.cloud.apigeeregistry.v1.IArtifact|null); + + /** CreateArtifactRequest artifactId */ + artifactId?: (string|null); + } + + /** Represents a CreateArtifactRequest. */ + class CreateArtifactRequest implements ICreateArtifactRequest { + + /** + * Constructs a new CreateArtifactRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.ICreateArtifactRequest); + + /** CreateArtifactRequest parent. */ + public parent: string; + + /** CreateArtifactRequest artifact. */ + public artifact?: (google.cloud.apigeeregistry.v1.IArtifact|null); + + /** CreateArtifactRequest artifactId. */ + public artifactId: string; + + /** + * Creates a new CreateArtifactRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateArtifactRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.ICreateArtifactRequest): google.cloud.apigeeregistry.v1.CreateArtifactRequest; + + /** + * Encodes the specified CreateArtifactRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateArtifactRequest.verify|verify} messages. + * @param message CreateArtifactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.ICreateArtifactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateArtifactRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateArtifactRequest.verify|verify} messages. + * @param message CreateArtifactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.ICreateArtifactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateArtifactRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.CreateArtifactRequest; + + /** + * Decodes a CreateArtifactRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.CreateArtifactRequest; + + /** + * Verifies a CreateArtifactRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateArtifactRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateArtifactRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.CreateArtifactRequest; + + /** + * Creates a plain object from a CreateArtifactRequest message. Also converts values to other types if specified. + * @param message CreateArtifactRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.CreateArtifactRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateArtifactRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateArtifactRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReplaceArtifactRequest. */ + interface IReplaceArtifactRequest { + + /** ReplaceArtifactRequest artifact */ + artifact?: (google.cloud.apigeeregistry.v1.IArtifact|null); + } + + /** Represents a ReplaceArtifactRequest. */ + class ReplaceArtifactRequest implements IReplaceArtifactRequest { + + /** + * Constructs a new ReplaceArtifactRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IReplaceArtifactRequest); + + /** ReplaceArtifactRequest artifact. */ + public artifact?: (google.cloud.apigeeregistry.v1.IArtifact|null); + + /** + * Creates a new ReplaceArtifactRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplaceArtifactRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IReplaceArtifactRequest): google.cloud.apigeeregistry.v1.ReplaceArtifactRequest; + + /** + * Encodes the specified ReplaceArtifactRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ReplaceArtifactRequest.verify|verify} messages. + * @param message ReplaceArtifactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IReplaceArtifactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplaceArtifactRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ReplaceArtifactRequest.verify|verify} messages. + * @param message ReplaceArtifactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IReplaceArtifactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplaceArtifactRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplaceArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.ReplaceArtifactRequest; + + /** + * Decodes a ReplaceArtifactRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplaceArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.ReplaceArtifactRequest; + + /** + * Verifies a ReplaceArtifactRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplaceArtifactRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplaceArtifactRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.ReplaceArtifactRequest; + + /** + * Creates a plain object from a ReplaceArtifactRequest message. Also converts values to other types if specified. + * @param message ReplaceArtifactRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.ReplaceArtifactRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplaceArtifactRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReplaceArtifactRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteArtifactRequest. */ + interface IDeleteArtifactRequest { + + /** DeleteArtifactRequest name */ + name?: (string|null); + } + + /** Represents a DeleteArtifactRequest. */ + class DeleteArtifactRequest implements IDeleteArtifactRequest { + + /** + * Constructs a new DeleteArtifactRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.apigeeregistry.v1.IDeleteArtifactRequest); + + /** DeleteArtifactRequest name. */ + public name: string; + + /** + * Creates a new DeleteArtifactRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteArtifactRequest instance + */ + public static create(properties?: google.cloud.apigeeregistry.v1.IDeleteArtifactRequest): google.cloud.apigeeregistry.v1.DeleteArtifactRequest; + + /** + * Encodes the specified DeleteArtifactRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteArtifactRequest.verify|verify} messages. + * @param message DeleteArtifactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.apigeeregistry.v1.IDeleteArtifactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteArtifactRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteArtifactRequest.verify|verify} messages. + * @param message DeleteArtifactRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.apigeeregistry.v1.IDeleteArtifactRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteArtifactRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.apigeeregistry.v1.DeleteArtifactRequest; + + /** + * Decodes a DeleteArtifactRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.apigeeregistry.v1.DeleteArtifactRequest; + + /** + * Verifies a DeleteArtifactRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteArtifactRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteArtifactRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.apigeeregistry.v1.DeleteArtifactRequest; + + /** + * Creates a plain object from a DeleteArtifactRequest message. Also converts values to other types if specified. + * @param message DeleteArtifactRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.apigeeregistry.v1.DeleteArtifactRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteArtifactRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteArtifactRequest + * @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); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpBody. */ + interface IHttpBody { + + /** HttpBody contentType */ + contentType?: (string|null); + + /** HttpBody data */ + data?: (Uint8Array|string|null); + + /** HttpBody extensions */ + extensions?: (google.protobuf.IAny[]|null); + } + + /** Represents a HttpBody. */ + class HttpBody implements IHttpBody { + + /** + * Constructs a new HttpBody. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpBody); + + /** HttpBody contentType. */ + public contentType: string; + + /** HttpBody data. */ + public data: (Uint8Array|string); + + /** HttpBody extensions. */ + public extensions: google.protobuf.IAny[]; + + /** + * Creates a new HttpBody instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpBody instance + */ + public static create(properties?: google.api.IHttpBody): google.api.HttpBody; + + /** + * Encodes the specified HttpBody message. Does not implicitly {@link google.api.HttpBody.verify|verify} messages. + * @param message HttpBody message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpBody, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpBody message, length delimited. Does not implicitly {@link google.api.HttpBody.verify|verify} messages. + * @param message HttpBody message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpBody, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpBody message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpBody + * @throws {Error} If the payload is not 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.HttpBody; + + /** + * Decodes a HttpBody message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpBody + * @throws {Error} If the payload 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.HttpBody; + + /** + * Verifies a HttpBody message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpBody message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpBody + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpBody; + + /** + * Creates a plain object from a HttpBody message. Also converts values to other types if specified. + * @param message HttpBody + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpBody, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpBody to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpBody + * @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; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions target */ + target?: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions target. */ + public target: (google.protobuf.FieldOptions.OptionTargetType|keyof typeof google.protobuf.FieldOptions.OptionTargetType); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/packages/google-cloud-apigeeregistry/protos/protos.js b/packages/google-cloud-apigeeregistry/protos/protos.js new file mode 100644 index 00000000000..c2c9af179f4 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/protos/protos.js @@ -0,0 +1,34270 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_apigee_registry_protos || ($protobuf.roots._google_cloud_apigee_registry_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.apigeeregistry = (function() { + + /** + * Namespace apigeeregistry. + * @memberof google.cloud + * @namespace + */ + var apigeeregistry = {}; + + apigeeregistry.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.apigeeregistry + * @namespace + */ + var v1 = {}; + + v1.Provisioning = (function() { + + /** + * Constructs a new Provisioning service. + * @memberof google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.v1.Provisioning|createInstance}. + * @memberof google.cloud.apigeeregistry.v1.Provisioning + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.apigeeregistry.v1.Provisioning + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Provisioning.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Provisioning.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.cloud.apigeeregistry.v1.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.apigeeregistry.v1.Provisioning + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Provisioning|deleteInstance}. + * @memberof google.cloud.apigeeregistry.v1.Provisioning + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.apigeeregistry.v1.Provisioning + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Provisioning.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Provisioning.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.cloud.apigeeregistry.v1.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.apigeeregistry.v1.Provisioning + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Provisioning|getInstance}. + * @memberof google.cloud.apigeeregistry.v1.Provisioning + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.apigeeregistry.v1.Provisioning + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Provisioning.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Provisioning.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.cloud.apigeeregistry.v1.GetInstanceRequest, $root.google.cloud.apigeeregistry.v1.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.apigeeregistry.v1.Provisioning + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Provisioning; + })(); + + v1.CreateInstanceRequest = (function() { + + /** + * Properties of a CreateInstanceRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {google.cloud.apigeeregistry.v1.IInstance|null} [instance] CreateInstanceRequest instance + */ + + /** + * Constructs a new CreateInstanceRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.ICreateInstanceRequest=} [properties] Properties to set + */ + function CreateInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.parent = ""; + + /** + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instanceId = ""; + + /** + * CreateInstanceRequest instance. + * @member {google.cloud.apigeeregistry.v1.IInstance|null|undefined} instance + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instance = null; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.CreateInstanceRequest} CreateInstanceRequest instance + */ + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.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.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.apigeeregistry.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.CreateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.instance = $root.google.cloud.apigeeregistry.v1.Instance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceRequest.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.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.apigeeregistry.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + return null; + }; + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.CreateInstanceRequest} CreateInstanceRequest + */ + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.CreateInstanceRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.CreateInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.apigeeregistry.v1.Instance.fromObject(object.instance); + } + return message; + }; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.CreateInstanceRequest} message CreateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.instanceId = ""; + object.instance = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.apigeeregistry.v1.Instance.toObject(message.instance, options); + return object; + }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.CreateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.CreateInstanceRequest"; + }; + + return CreateInstanceRequest; + })(); + + v1.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IDeleteInstanceRequest=} [properties] Properties to set + */ + function DeleteInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.name = ""; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.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 DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.DeleteInstanceRequest(); + 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 DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.DeleteInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstanceRequest.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 DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.DeleteInstanceRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceRequest.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 DeleteInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.DeleteInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.DeleteInstanceRequest"; + }; + + return DeleteInstanceRequest; + })(); + + v1.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IGetInstanceRequest=} [properties] Properties to set + */ + function GetInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.GetInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.GetInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.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 GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.GetInstanceRequest(); + 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 GetInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.GetInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceRequest.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 GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.GetInstanceRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.GetInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.GetInstanceRequest + * @static + * @param {google.cloud.apigeeregistry.v1.GetInstanceRequest} message GetInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceRequest.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 GetInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.GetInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.GetInstanceRequest"; + }; + + return GetInstanceRequest; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.apigeeregistry.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} [cancellationRequested] OperationMetadata cancellationRequested + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.apigeeregistry.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.apigeeregistry.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.apigeeregistry.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.apigeeregistry.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.apigeeregistry.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.apigeeregistry.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata cancellationRequested. + * @member {boolean} cancellationRequested + * @memberof google.cloud.apigeeregistry.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.cancellationRequested = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.apigeeregistry.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.OperationMetadata + * @static + * @param {google.cloud.apigeeregistry.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.apigeeregistry.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.OperationMetadata + * @static + * @param {google.cloud.apigeeregistry.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.cancellationRequested != null && Object.hasOwnProperty.call(message, "cancellationRequested")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.cancellationRequested); + 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.apigeeregistry.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.OperationMetadata + * @static + * @param {google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.cancellationRequested = 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.apigeeregistry.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.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.apigeeregistry.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.cancellationRequested != null && message.hasOwnProperty("cancellationRequested")) + if (typeof message.cancellationRequested !== "boolean") + return "cancellationRequested: 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.apigeeregistry.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.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.apigeeregistry.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.cancellationRequested != null) + message.cancellationRequested = Boolean(object.cancellationRequested); + 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.apigeeregistry.v1.OperationMetadata + * @static + * @param {google.cloud.apigeeregistry.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.cancellationRequested = 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.cancellationRequested != null && message.hasOwnProperty("cancellationRequested")) + object.cancellationRequested = message.cancellationRequested; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime + * @property {google.cloud.apigeeregistry.v1.Instance.State|null} [state] Instance state + * @property {string|null} [stateMessage] Instance stateMessage + * @property {google.cloud.apigeeregistry.v1.Instance.IConfig|null} [config] Instance config + */ + + /** + * Constructs a new Instance. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.apigeeregistry.v1.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Instance name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apigeeregistry.v1.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apigeeregistry.v1.Instance + * @instance + */ + Instance.prototype.updateTime = null; + + /** + * Instance state. + * @member {google.cloud.apigeeregistry.v1.Instance.State} state + * @memberof google.cloud.apigeeregistry.v1.Instance + * @instance + */ + Instance.prototype.state = 0; + + /** + * Instance stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.apigeeregistry.v1.Instance + * @instance + */ + Instance.prototype.stateMessage = ""; + + /** + * Instance config. + * @member {google.cloud.apigeeregistry.v1.Instance.IConfig|null|undefined} config + * @memberof google.cloud.apigeeregistry.v1.Instance + * @instance + */ + Instance.prototype.config = null; + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.Instance + * @static + * @param {google.cloud.apigeeregistry.v1.IInstance=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.apigeeregistry.v1.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.Instance + * @static + * @param {google.cloud.apigeeregistry.v1.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.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.apigeeregistry.v1.Instance.Config.encode(message.config, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.Instance + * @static + * @param {google.cloud.apigeeregistry.v1.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.Instance(); + 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.apigeeregistry.v1.Instance.Config.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instance message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.Instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instance.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.apigeeregistry.v1.Instance.Config.verify(message.config); + if (error) + return "config." + error; + } + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.Instance) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.config: object expected"); + message.config = $root.google.cloud.apigeeregistry.v1.Instance.Config.fromObject(object.config); + } + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.Instance + * @static + * @param {google.cloud.apigeeregistry.v1.Instance} message Instance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateMessage = ""; + object.config = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.apigeeregistry.v1.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.Config.toObject(message.config, options); + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.Instance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.Instance"; + }; + + /** + * State enum. + * @name google.cloud.apigeeregistry.v1.Instance.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 + */ + Instance.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; + })(); + + Instance.Config = (function() { + + /** + * Properties of a Config. + * @memberof google.cloud.apigeeregistry.v1.Instance + * @interface IConfig + * @property {string|null} [location] Config location + * @property {string|null} [cmekKeyName] Config cmekKeyName + */ + + /** + * Constructs a new Config. + * @memberof google.cloud.apigeeregistry.v1.Instance + * @classdesc Represents a Config. + * @implements IConfig + * @constructor + * @param {google.cloud.apigeeregistry.v1.Instance.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 location. + * @member {string} location + * @memberof google.cloud.apigeeregistry.v1.Instance.Config + * @instance + */ + Config.prototype.location = ""; + + /** + * Config cmekKeyName. + * @member {string} cmekKeyName + * @memberof google.cloud.apigeeregistry.v1.Instance.Config + * @instance + */ + Config.prototype.cmekKeyName = ""; + + /** + * Creates a new Config instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.Instance.Config + * @static + * @param {google.cloud.apigeeregistry.v1.Instance.IConfig=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.Instance.Config} Config instance + */ + Config.create = function create(properties) { + return new Config(properties); + }; + + /** + * Encodes the specified Config message. Does not implicitly {@link google.cloud.apigeeregistry.v1.Instance.Config.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.Instance.Config + * @static + * @param {google.cloud.apigeeregistry.v1.Instance.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.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.cmekKeyName != null && Object.hasOwnProperty.call(message, "cmekKeyName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cmekKeyName); + return writer; + }; + + /** + * Encodes the specified Config message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.Instance.Config.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.Instance.Config + * @static + * @param {google.cloud.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.Config + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.Config(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + case 2: { + 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.apigeeregistry.v1.Instance.Config + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.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.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string 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.apigeeregistry.v1.Instance.Config + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.Instance.Config} Config + */ + Config.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.Instance.Config) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.Instance.Config(); + if (object.location != null) + message.location = String(object.location); + 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.apigeeregistry.v1.Instance.Config + * @static + * @param {google.cloud.apigeeregistry.v1.Instance.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.location = ""; + object.cmekKeyName = ""; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.cmekKeyName != null && message.hasOwnProperty("cmekKeyName")) + object.cmekKeyName = message.cmekKeyName; + return object; + }; + + /** + * Converts this Config to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.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.apigeeregistry.v1.Instance.Config"; + }; + + return Config; + })(); + + return Instance; + })(); + + v1.Api = (function() { + + /** + * Properties of an Api. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IApi + * @property {string|null} [name] Api name + * @property {string|null} [displayName] Api displayName + * @property {string|null} [description] Api description + * @property {google.protobuf.ITimestamp|null} [createTime] Api createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Api updateTime + * @property {string|null} [availability] Api availability + * @property {string|null} [recommendedVersion] Api recommendedVersion + * @property {string|null} [recommendedDeployment] Api recommendedDeployment + * @property {Object.|null} [labels] Api labels + * @property {Object.|null} [annotations] Api annotations + */ + + /** + * Constructs a new Api. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents an Api. + * @implements IApi + * @constructor + * @param {google.cloud.apigeeregistry.v1.IApi=} [properties] Properties to set + */ + function Api(properties) { + this.labels = {}; + this.annotations = {}; + if (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.apigeeregistry.v1.Api + * @instance + */ + Api.prototype.name = ""; + + /** + * Api displayName. + * @member {string} displayName + * @memberof google.cloud.apigeeregistry.v1.Api + * @instance + */ + Api.prototype.displayName = ""; + + /** + * Api description. + * @member {string} description + * @memberof google.cloud.apigeeregistry.v1.Api + * @instance + */ + Api.prototype.description = ""; + + /** + * Api createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apigeeregistry.v1.Api + * @instance + */ + Api.prototype.createTime = null; + + /** + * Api updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apigeeregistry.v1.Api + * @instance + */ + Api.prototype.updateTime = null; + + /** + * Api availability. + * @member {string} availability + * @memberof google.cloud.apigeeregistry.v1.Api + * @instance + */ + Api.prototype.availability = ""; + + /** + * Api recommendedVersion. + * @member {string} recommendedVersion + * @memberof google.cloud.apigeeregistry.v1.Api + * @instance + */ + Api.prototype.recommendedVersion = ""; + + /** + * Api recommendedDeployment. + * @member {string} recommendedDeployment + * @memberof google.cloud.apigeeregistry.v1.Api + * @instance + */ + Api.prototype.recommendedDeployment = ""; + + /** + * Api labels. + * @member {Object.} labels + * @memberof google.cloud.apigeeregistry.v1.Api + * @instance + */ + Api.prototype.labels = $util.emptyObject; + + /** + * Api annotations. + * @member {Object.} annotations + * @memberof google.cloud.apigeeregistry.v1.Api + * @instance + */ + Api.prototype.annotations = $util.emptyObject; + + /** + * Creates a new Api instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.Api + * @static + * @param {google.cloud.apigeeregistry.v1.IApi=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.Api} Api instance + */ + Api.create = function create(properties) { + return new Api(properties); + }; + + /** + * Encodes the specified Api message. Does not implicitly {@link google.cloud.apigeeregistry.v1.Api.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.Api + * @static + * @param {google.cloud.apigeeregistry.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.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.availability != null && Object.hasOwnProperty.call(message, "availability")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.availability); + if (message.recommendedVersion != null && Object.hasOwnProperty.call(message, "recommendedVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.recommendedVersion); + if (message.recommendedDeployment != null && Object.hasOwnProperty.call(message, "recommendedDeployment")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.recommendedDeployment); + 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 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Api message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.Api.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.Api + * @static + * @param {google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.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: { + message.availability = reader.string(); + break; + } + case 7: { + message.recommendedVersion = reader.string(); + break; + } + case 8: { + message.recommendedDeployment = reader.string(); + break; + } + case 9: { + 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 10: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + 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.annotations[key] = value; + 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.apigeeregistry.v1.Api + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.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.apigeeregistry.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.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.availability != null && message.hasOwnProperty("availability")) + if (!$util.isString(message.availability)) + return "availability: string expected"; + if (message.recommendedVersion != null && message.hasOwnProperty("recommendedVersion")) + if (!$util.isString(message.recommendedVersion)) + return "recommendedVersion: string expected"; + if (message.recommendedDeployment != null && message.hasOwnProperty("recommendedDeployment")) + if (!$util.isString(message.recommendedDeployment)) + return "recommendedDeployment: string expected"; + 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.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k: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.apigeeregistry.v1.Api + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.Api} Api + */ + Api.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.Api) + return object; + var message = new $root.google.cloud.apigeeregistry.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.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.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.apigeeregistry.v1.Api.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.availability != null) + message.availability = String(object.availability); + if (object.recommendedVersion != null) + message.recommendedVersion = String(object.recommendedVersion); + if (object.recommendedDeployment != null) + message.recommendedDeployment = String(object.recommendedDeployment); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.Api.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.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.Api.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an Api message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.Api + * @static + * @param {google.cloud.apigeeregistry.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.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.availability = ""; + object.recommendedVersion = ""; + object.recommendedDeployment = ""; + } + 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.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.availability != null && message.hasOwnProperty("availability")) + object.availability = message.availability; + if (message.recommendedVersion != null && message.hasOwnProperty("recommendedVersion")) + object.recommendedVersion = message.recommendedVersion; + if (message.recommendedDeployment != null && message.hasOwnProperty("recommendedDeployment")) + object.recommendedDeployment = message.recommendedDeployment; + 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.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + return object; + }; + + /** + * Converts this Api to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.v1.Api"; + }; + + return Api; + })(); + + v1.ApiVersion = (function() { + + /** + * Properties of an ApiVersion. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IApiVersion + * @property {string|null} [name] ApiVersion name + * @property {string|null} [displayName] ApiVersion displayName + * @property {string|null} [description] ApiVersion description + * @property {google.protobuf.ITimestamp|null} [createTime] ApiVersion createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ApiVersion updateTime + * @property {string|null} [state] ApiVersion state + * @property {Object.|null} [labels] ApiVersion labels + * @property {Object.|null} [annotations] ApiVersion annotations + */ + + /** + * Constructs a new ApiVersion. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents an ApiVersion. + * @implements IApiVersion + * @constructor + * @param {google.cloud.apigeeregistry.v1.IApiVersion=} [properties] Properties to set + */ + function ApiVersion(properties) { + this.labels = {}; + this.annotations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApiVersion name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @instance + */ + ApiVersion.prototype.name = ""; + + /** + * ApiVersion displayName. + * @member {string} displayName + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @instance + */ + ApiVersion.prototype.displayName = ""; + + /** + * ApiVersion description. + * @member {string} description + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @instance + */ + ApiVersion.prototype.description = ""; + + /** + * ApiVersion createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @instance + */ + ApiVersion.prototype.createTime = null; + + /** + * ApiVersion updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @instance + */ + ApiVersion.prototype.updateTime = null; + + /** + * ApiVersion state. + * @member {string} state + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @instance + */ + ApiVersion.prototype.state = ""; + + /** + * ApiVersion labels. + * @member {Object.} labels + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @instance + */ + ApiVersion.prototype.labels = $util.emptyObject; + + /** + * ApiVersion annotations. + * @member {Object.} annotations + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @instance + */ + ApiVersion.prototype.annotations = $util.emptyObject; + + /** + * Creates a new ApiVersion instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @static + * @param {google.cloud.apigeeregistry.v1.IApiVersion=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ApiVersion} ApiVersion instance + */ + ApiVersion.create = function create(properties) { + return new ApiVersion(properties); + }; + + /** + * Encodes the specified ApiVersion message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @static + * @param {google.cloud.apigeeregistry.v1.IApiVersion} message ApiVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiVersion.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.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.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.state); + 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.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApiVersion message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @static + * @param {google.cloud.apigeeregistry.v1.IApiVersion} message ApiVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ApiVersion} ApiVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiVersion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ApiVersion(), 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.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: { + message.state = reader.string(); + 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: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + 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.annotations[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ApiVersion} ApiVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiVersion message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiVersion.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.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")) + if (!$util.isString(message.state)) + return "state: string expected"; + 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.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an ApiVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ApiVersion} ApiVersion + */ + ApiVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ApiVersion) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ApiVersion(); + 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.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiVersion.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.apigeeregistry.v1.ApiVersion.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.state != null) + message.state = String(object.state); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiVersion.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.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiVersion.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an ApiVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @static + * @param {google.cloud.apigeeregistry.v1.ApiVersion} message ApiVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.state = ""; + } + 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.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 = message.state; + 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.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + return object; + }; + + /** + * Converts this ApiVersion to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @instance + * @returns {Object.} JSON object + */ + ApiVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiVersion + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ApiVersion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiVersion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ApiVersion"; + }; + + return ApiVersion; + })(); + + v1.ApiSpec = (function() { + + /** + * Properties of an ApiSpec. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IApiSpec + * @property {string|null} [name] ApiSpec name + * @property {string|null} [filename] ApiSpec filename + * @property {string|null} [description] ApiSpec description + * @property {string|null} [revisionId] ApiSpec revisionId + * @property {google.protobuf.ITimestamp|null} [createTime] ApiSpec createTime + * @property {google.protobuf.ITimestamp|null} [revisionCreateTime] ApiSpec revisionCreateTime + * @property {google.protobuf.ITimestamp|null} [revisionUpdateTime] ApiSpec revisionUpdateTime + * @property {string|null} [mimeType] ApiSpec mimeType + * @property {number|null} [sizeBytes] ApiSpec sizeBytes + * @property {string|null} [hash] ApiSpec hash + * @property {string|null} [sourceUri] ApiSpec sourceUri + * @property {Uint8Array|null} [contents] ApiSpec contents + * @property {Object.|null} [labels] ApiSpec labels + * @property {Object.|null} [annotations] ApiSpec annotations + */ + + /** + * Constructs a new ApiSpec. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents an ApiSpec. + * @implements IApiSpec + * @constructor + * @param {google.cloud.apigeeregistry.v1.IApiSpec=} [properties] Properties to set + */ + function ApiSpec(properties) { + this.labels = {}; + this.annotations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApiSpec name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.name = ""; + + /** + * ApiSpec filename. + * @member {string} filename + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.filename = ""; + + /** + * ApiSpec description. + * @member {string} description + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.description = ""; + + /** + * ApiSpec revisionId. + * @member {string} revisionId + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.revisionId = ""; + + /** + * ApiSpec createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.createTime = null; + + /** + * ApiSpec revisionCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} revisionCreateTime + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.revisionCreateTime = null; + + /** + * ApiSpec revisionUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} revisionUpdateTime + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.revisionUpdateTime = null; + + /** + * ApiSpec mimeType. + * @member {string} mimeType + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.mimeType = ""; + + /** + * ApiSpec sizeBytes. + * @member {number} sizeBytes + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.sizeBytes = 0; + + /** + * ApiSpec hash. + * @member {string} hash + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.hash = ""; + + /** + * ApiSpec sourceUri. + * @member {string} sourceUri + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.sourceUri = ""; + + /** + * ApiSpec contents. + * @member {Uint8Array} contents + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.contents = $util.newBuffer([]); + + /** + * ApiSpec labels. + * @member {Object.} labels + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.labels = $util.emptyObject; + + /** + * ApiSpec annotations. + * @member {Object.} annotations + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + */ + ApiSpec.prototype.annotations = $util.emptyObject; + + /** + * Creates a new ApiSpec instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @static + * @param {google.cloud.apigeeregistry.v1.IApiSpec=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ApiSpec} ApiSpec instance + */ + ApiSpec.create = function create(properties) { + return new ApiSpec(properties); + }; + + /** + * Encodes the specified ApiSpec message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @static + * @param {google.cloud.apigeeregistry.v1.IApiSpec} message ApiSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiSpec.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.filename != null && Object.hasOwnProperty.call(message, "filename")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filename); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.revisionId); + 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.revisionCreateTime != null && Object.hasOwnProperty.call(message, "revisionCreateTime")) + $root.google.protobuf.Timestamp.encode(message.revisionCreateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.revisionUpdateTime != null && Object.hasOwnProperty.call(message, "revisionUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.revisionUpdateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.mimeType); + if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.sizeBytes); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.hash); + if (message.sourceUri != null && Object.hasOwnProperty.call(message, "sourceUri")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.sourceUri); + if (message.contents != null && Object.hasOwnProperty.call(message, "contents")) + writer.uint32(/* id 12, wireType 2 =*/98).bytes(message.contents); + 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 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApiSpec message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @static + * @param {google.cloud.apigeeregistry.v1.IApiSpec} message ApiSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ApiSpec} ApiSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ApiSpec(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.filename = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.revisionId = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.revisionCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.revisionUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.mimeType = reader.string(); + break; + } + case 9: { + message.sizeBytes = reader.int32(); + break; + } + case 10: { + message.hash = reader.string(); + break; + } + case 11: { + message.sourceUri = reader.string(); + break; + } + case 12: { + message.contents = reader.bytes(); + break; + } + case 14: { + 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 15: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + 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.annotations[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ApiSpec} ApiSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiSpec message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiSpec.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.filename != null && message.hasOwnProperty("filename")) + if (!$util.isString(message.filename)) + return "filename: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: 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.revisionCreateTime != null && message.hasOwnProperty("revisionCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.revisionCreateTime); + if (error) + return "revisionCreateTime." + error; + } + if (message.revisionUpdateTime != null && message.hasOwnProperty("revisionUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.revisionUpdateTime); + if (error) + return "revisionUpdateTime." + error; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (!$util.isInteger(message.sizeBytes)) + return "sizeBytes: integer expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!$util.isString(message.hash)) + return "hash: string expected"; + if (message.sourceUri != null && message.hasOwnProperty("sourceUri")) + if (!$util.isString(message.sourceUri)) + return "sourceUri: string 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.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.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an ApiSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ApiSpec} ApiSpec + */ + ApiSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ApiSpec) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ApiSpec(); + if (object.name != null) + message.name = String(object.name); + if (object.filename != null) + message.filename = String(object.filename); + if (object.description != null) + message.description = String(object.description); + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiSpec.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.revisionCreateTime != null) { + if (typeof object.revisionCreateTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiSpec.revisionCreateTime: object expected"); + message.revisionCreateTime = $root.google.protobuf.Timestamp.fromObject(object.revisionCreateTime); + } + if (object.revisionUpdateTime != null) { + if (typeof object.revisionUpdateTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiSpec.revisionUpdateTime: object expected"); + message.revisionUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.revisionUpdateTime); + } + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.sizeBytes != null) + message.sizeBytes = object.sizeBytes | 0; + if (object.hash != null) + message.hash = String(object.hash); + if (object.sourceUri != null) + message.sourceUri = String(object.sourceUri); + 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.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiSpec.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.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiSpec.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an ApiSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @static + * @param {google.cloud.apigeeregistry.v1.ApiSpec} message ApiSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.filename = ""; + object.description = ""; + object.revisionId = ""; + object.createTime = null; + object.revisionCreateTime = null; + object.revisionUpdateTime = null; + object.mimeType = ""; + object.sizeBytes = 0; + object.hash = ""; + object.sourceUri = ""; + if (options.bytes === String) + object.contents = ""; + else { + object.contents = []; + if (options.bytes !== Array) + object.contents = $util.newBuffer(object.contents); + } + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.filename != null && message.hasOwnProperty("filename")) + object.filename = message.filename; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.revisionCreateTime != null && message.hasOwnProperty("revisionCreateTime")) + object.revisionCreateTime = $root.google.protobuf.Timestamp.toObject(message.revisionCreateTime, options); + if (message.revisionUpdateTime != null && message.hasOwnProperty("revisionUpdateTime")) + object.revisionUpdateTime = $root.google.protobuf.Timestamp.toObject(message.revisionUpdateTime, options); + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + object.sizeBytes = message.sizeBytes; + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = message.hash; + if (message.sourceUri != null && message.hasOwnProperty("sourceUri")) + object.sourceUri = message.sourceUri; + 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; + 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.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + return object; + }; + + /** + * Converts this ApiSpec to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @instance + * @returns {Object.} JSON object + */ + ApiSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiSpec + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ApiSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ApiSpec"; + }; + + return ApiSpec; + })(); + + v1.ApiDeployment = (function() { + + /** + * Properties of an ApiDeployment. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IApiDeployment + * @property {string|null} [name] ApiDeployment name + * @property {string|null} [displayName] ApiDeployment displayName + * @property {string|null} [description] ApiDeployment description + * @property {string|null} [revisionId] ApiDeployment revisionId + * @property {google.protobuf.ITimestamp|null} [createTime] ApiDeployment createTime + * @property {google.protobuf.ITimestamp|null} [revisionCreateTime] ApiDeployment revisionCreateTime + * @property {google.protobuf.ITimestamp|null} [revisionUpdateTime] ApiDeployment revisionUpdateTime + * @property {string|null} [apiSpecRevision] ApiDeployment apiSpecRevision + * @property {string|null} [endpointUri] ApiDeployment endpointUri + * @property {string|null} [externalChannelUri] ApiDeployment externalChannelUri + * @property {string|null} [intendedAudience] ApiDeployment intendedAudience + * @property {string|null} [accessGuidance] ApiDeployment accessGuidance + * @property {Object.|null} [labels] ApiDeployment labels + * @property {Object.|null} [annotations] ApiDeployment annotations + */ + + /** + * Constructs a new ApiDeployment. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents an ApiDeployment. + * @implements IApiDeployment + * @constructor + * @param {google.cloud.apigeeregistry.v1.IApiDeployment=} [properties] Properties to set + */ + function ApiDeployment(properties) { + this.labels = {}; + this.annotations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApiDeployment name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.name = ""; + + /** + * ApiDeployment displayName. + * @member {string} displayName + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.displayName = ""; + + /** + * ApiDeployment description. + * @member {string} description + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.description = ""; + + /** + * ApiDeployment revisionId. + * @member {string} revisionId + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.revisionId = ""; + + /** + * ApiDeployment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.createTime = null; + + /** + * ApiDeployment revisionCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} revisionCreateTime + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.revisionCreateTime = null; + + /** + * ApiDeployment revisionUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} revisionUpdateTime + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.revisionUpdateTime = null; + + /** + * ApiDeployment apiSpecRevision. + * @member {string} apiSpecRevision + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.apiSpecRevision = ""; + + /** + * ApiDeployment endpointUri. + * @member {string} endpointUri + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.endpointUri = ""; + + /** + * ApiDeployment externalChannelUri. + * @member {string} externalChannelUri + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.externalChannelUri = ""; + + /** + * ApiDeployment intendedAudience. + * @member {string} intendedAudience + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.intendedAudience = ""; + + /** + * ApiDeployment accessGuidance. + * @member {string} accessGuidance + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.accessGuidance = ""; + + /** + * ApiDeployment labels. + * @member {Object.} labels + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.labels = $util.emptyObject; + + /** + * ApiDeployment annotations. + * @member {Object.} annotations + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + */ + ApiDeployment.prototype.annotations = $util.emptyObject; + + /** + * Creates a new ApiDeployment instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @static + * @param {google.cloud.apigeeregistry.v1.IApiDeployment=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ApiDeployment} ApiDeployment instance + */ + ApiDeployment.create = function create(properties) { + return new ApiDeployment(properties); + }; + + /** + * Encodes the specified ApiDeployment message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiDeployment.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @static + * @param {google.cloud.apigeeregistry.v1.IApiDeployment} message ApiDeployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiDeployment.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.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.revisionId); + 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.revisionCreateTime != null && Object.hasOwnProperty.call(message, "revisionCreateTime")) + $root.google.protobuf.Timestamp.encode(message.revisionCreateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.revisionUpdateTime != null && Object.hasOwnProperty.call(message, "revisionUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.revisionUpdateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.apiSpecRevision != null && Object.hasOwnProperty.call(message, "apiSpecRevision")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.apiSpecRevision); + if (message.endpointUri != null && Object.hasOwnProperty.call(message, "endpointUri")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.endpointUri); + if (message.externalChannelUri != null && Object.hasOwnProperty.call(message, "externalChannelUri")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.externalChannelUri); + if (message.intendedAudience != null && Object.hasOwnProperty.call(message, "intendedAudience")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.intendedAudience); + if (message.accessGuidance != null && Object.hasOwnProperty.call(message, "accessGuidance")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.accessGuidance); + 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 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApiDeployment message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ApiDeployment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @static + * @param {google.cloud.apigeeregistry.v1.IApiDeployment} message ApiDeployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiDeployment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiDeployment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ApiDeployment} ApiDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiDeployment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ApiDeployment(), 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.revisionId = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.revisionCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.revisionUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.apiSpecRevision = reader.string(); + break; + } + case 9: { + message.endpointUri = reader.string(); + break; + } + case 10: { + message.externalChannelUri = reader.string(); + break; + } + case 11: { + message.intendedAudience = reader.string(); + break; + } + case 12: { + message.accessGuidance = reader.string(); + break; + } + case 14: { + 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 15: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + 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.annotations[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiDeployment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ApiDeployment} ApiDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiDeployment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiDeployment message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiDeployment.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.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: 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.revisionCreateTime != null && message.hasOwnProperty("revisionCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.revisionCreateTime); + if (error) + return "revisionCreateTime." + error; + } + if (message.revisionUpdateTime != null && message.hasOwnProperty("revisionUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.revisionUpdateTime); + if (error) + return "revisionUpdateTime." + error; + } + if (message.apiSpecRevision != null && message.hasOwnProperty("apiSpecRevision")) + if (!$util.isString(message.apiSpecRevision)) + return "apiSpecRevision: string expected"; + if (message.endpointUri != null && message.hasOwnProperty("endpointUri")) + if (!$util.isString(message.endpointUri)) + return "endpointUri: string expected"; + if (message.externalChannelUri != null && message.hasOwnProperty("externalChannelUri")) + if (!$util.isString(message.externalChannelUri)) + return "externalChannelUri: string expected"; + if (message.intendedAudience != null && message.hasOwnProperty("intendedAudience")) + if (!$util.isString(message.intendedAudience)) + return "intendedAudience: string expected"; + if (message.accessGuidance != null && message.hasOwnProperty("accessGuidance")) + if (!$util.isString(message.accessGuidance)) + return "accessGuidance: string expected"; + 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.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an ApiDeployment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ApiDeployment} ApiDeployment + */ + ApiDeployment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ApiDeployment) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ApiDeployment(); + 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.revisionId != null) + message.revisionId = String(object.revisionId); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiDeployment.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.revisionCreateTime != null) { + if (typeof object.revisionCreateTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiDeployment.revisionCreateTime: object expected"); + message.revisionCreateTime = $root.google.protobuf.Timestamp.fromObject(object.revisionCreateTime); + } + if (object.revisionUpdateTime != null) { + if (typeof object.revisionUpdateTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiDeployment.revisionUpdateTime: object expected"); + message.revisionUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.revisionUpdateTime); + } + if (object.apiSpecRevision != null) + message.apiSpecRevision = String(object.apiSpecRevision); + if (object.endpointUri != null) + message.endpointUri = String(object.endpointUri); + if (object.externalChannelUri != null) + message.externalChannelUri = String(object.externalChannelUri); + if (object.intendedAudience != null) + message.intendedAudience = String(object.intendedAudience); + if (object.accessGuidance != null) + message.accessGuidance = String(object.accessGuidance); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiDeployment.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.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ApiDeployment.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an ApiDeployment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @static + * @param {google.cloud.apigeeregistry.v1.ApiDeployment} message ApiDeployment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiDeployment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.revisionId = ""; + object.createTime = null; + object.revisionCreateTime = null; + object.revisionUpdateTime = null; + object.apiSpecRevision = ""; + object.endpointUri = ""; + object.externalChannelUri = ""; + object.intendedAudience = ""; + object.accessGuidance = ""; + } + 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.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.revisionCreateTime != null && message.hasOwnProperty("revisionCreateTime")) + object.revisionCreateTime = $root.google.protobuf.Timestamp.toObject(message.revisionCreateTime, options); + if (message.revisionUpdateTime != null && message.hasOwnProperty("revisionUpdateTime")) + object.revisionUpdateTime = $root.google.protobuf.Timestamp.toObject(message.revisionUpdateTime, options); + if (message.apiSpecRevision != null && message.hasOwnProperty("apiSpecRevision")) + object.apiSpecRevision = message.apiSpecRevision; + if (message.endpointUri != null && message.hasOwnProperty("endpointUri")) + object.endpointUri = message.endpointUri; + if (message.externalChannelUri != null && message.hasOwnProperty("externalChannelUri")) + object.externalChannelUri = message.externalChannelUri; + if (message.intendedAudience != null && message.hasOwnProperty("intendedAudience")) + object.intendedAudience = message.intendedAudience; + if (message.accessGuidance != null && message.hasOwnProperty("accessGuidance")) + object.accessGuidance = message.accessGuidance; + 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.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + return object; + }; + + /** + * Converts this ApiDeployment to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @instance + * @returns {Object.} JSON object + */ + ApiDeployment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiDeployment + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ApiDeployment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiDeployment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ApiDeployment"; + }; + + return ApiDeployment; + })(); + + v1.Artifact = (function() { + + /** + * Properties of an Artifact. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IArtifact + * @property {string|null} [name] Artifact name + * @property {google.protobuf.ITimestamp|null} [createTime] Artifact createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Artifact updateTime + * @property {string|null} [mimeType] Artifact mimeType + * @property {number|null} [sizeBytes] Artifact sizeBytes + * @property {string|null} [hash] Artifact hash + * @property {Uint8Array|null} [contents] Artifact contents + */ + + /** + * Constructs a new Artifact. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents an Artifact. + * @implements IArtifact + * @constructor + * @param {google.cloud.apigeeregistry.v1.IArtifact=} [properties] Properties to set + */ + function Artifact(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Artifact name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @instance + */ + Artifact.prototype.name = ""; + + /** + * Artifact createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @instance + */ + Artifact.prototype.createTime = null; + + /** + * Artifact updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @instance + */ + Artifact.prototype.updateTime = null; + + /** + * Artifact mimeType. + * @member {string} mimeType + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @instance + */ + Artifact.prototype.mimeType = ""; + + /** + * Artifact sizeBytes. + * @member {number} sizeBytes + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @instance + */ + Artifact.prototype.sizeBytes = 0; + + /** + * Artifact hash. + * @member {string} hash + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @instance + */ + Artifact.prototype.hash = ""; + + /** + * Artifact contents. + * @member {Uint8Array} contents + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @instance + */ + Artifact.prototype.contents = $util.newBuffer([]); + + /** + * Creates a new Artifact instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @static + * @param {google.cloud.apigeeregistry.v1.IArtifact=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.Artifact} Artifact instance + */ + Artifact.create = function create(properties) { + return new Artifact(properties); + }; + + /** + * Encodes the specified Artifact message. Does not implicitly {@link google.cloud.apigeeregistry.v1.Artifact.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @static + * @param {google.cloud.apigeeregistry.v1.IArtifact} message Artifact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Artifact.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.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.mimeType); + if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.sizeBytes); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.hash); + if (message.contents != null && Object.hasOwnProperty.call(message, "contents")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.contents); + return writer; + }; + + /** + * Encodes the specified Artifact message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.Artifact.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @static + * @param {google.cloud.apigeeregistry.v1.IArtifact} message Artifact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Artifact.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Artifact message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.Artifact} Artifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Artifact.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.Artifact(); + 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.mimeType = reader.string(); + break; + } + case 5: { + message.sizeBytes = reader.int32(); + break; + } + case 6: { + message.hash = reader.string(); + break; + } + case 7: { + message.contents = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Artifact message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.Artifact} Artifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Artifact.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Artifact message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Artifact.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.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (!$util.isInteger(message.sizeBytes)) + return "sizeBytes: integer expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!$util.isString(message.hash)) + return "hash: string expected"; + if (message.contents != null && message.hasOwnProperty("contents")) + if (!(message.contents && typeof message.contents.length === "number" || $util.isString(message.contents))) + return "contents: buffer expected"; + return null; + }; + + /** + * Creates an Artifact message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.Artifact} Artifact + */ + Artifact.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.Artifact) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.Artifact(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.Artifact.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.apigeeregistry.v1.Artifact.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.sizeBytes != null) + message.sizeBytes = object.sizeBytes | 0; + if (object.hash != null) + message.hash = String(object.hash); + 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; + return message; + }; + + /** + * Creates a plain object from an Artifact message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @static + * @param {google.cloud.apigeeregistry.v1.Artifact} message Artifact + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Artifact.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.mimeType = ""; + object.sizeBytes = 0; + object.hash = ""; + if (options.bytes === String) + object.contents = ""; + else { + object.contents = []; + if (options.bytes !== Array) + object.contents = $util.newBuffer(object.contents); + } + } + 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.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + object.sizeBytes = message.sizeBytes; + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = message.hash; + 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; + return object; + }; + + /** + * Converts this Artifact to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @instance + * @returns {Object.} JSON object + */ + Artifact.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Artifact + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.Artifact + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Artifact.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.Artifact"; + }; + + return Artifact; + })(); + + v1.Registry = (function() { + + /** + * Constructs a new Registry service. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a Registry + * @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 Registry(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Registry.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Registry; + + /** + * Creates new Registry service using the specified rpc implementation. + * @function create + * @memberof google.cloud.apigeeregistry.v1.Registry + * @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 {Registry} RPC service. Useful where requests and/or responses are streamed. + */ + Registry.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApis}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef ListApisCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ListApisResponse} [response] ListApisResponse + */ + + /** + * Calls ListApis. + * @function listApis + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApisRequest} request ListApisRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.ListApisCallback} callback Node-style callback called with the error, if any, and ListApisResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.listApis = function listApis(request, callback) { + return this.rpcCall(listApis, $root.google.cloud.apigeeregistry.v1.ListApisRequest, $root.google.cloud.apigeeregistry.v1.ListApisResponse, request, callback); + }, "name", { value: "ListApis" }); + + /** + * Calls ListApis. + * @function listApis + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApisRequest} request ListApisRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getApi}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef GetApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.Api} [response] Api + */ + + /** + * Calls GetApi. + * @function getApi + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetApiRequest} request GetApiRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.GetApiCallback} callback Node-style callback called with the error, if any, and Api + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.getApi = function getApi(request, callback) { + return this.rpcCall(getApi, $root.google.cloud.apigeeregistry.v1.GetApiRequest, $root.google.cloud.apigeeregistry.v1.Api, request, callback); + }, "name", { value: "GetApi" }); + + /** + * Calls GetApi. + * @function getApi + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetApiRequest} request GetApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|createApi}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef CreateApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.Api} [response] Api + */ + + /** + * Calls CreateApi. + * @function createApi + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateApiRequest} request CreateApiRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.CreateApiCallback} callback Node-style callback called with the error, if any, and Api + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.createApi = function createApi(request, callback) { + return this.rpcCall(createApi, $root.google.cloud.apigeeregistry.v1.CreateApiRequest, $root.google.cloud.apigeeregistry.v1.Api, request, callback); + }, "name", { value: "CreateApi" }); + + /** + * Calls CreateApi. + * @function createApi + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateApiRequest} request CreateApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|updateApi}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef UpdateApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.Api} [response] Api + */ + + /** + * Calls UpdateApi. + * @function updateApi + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IUpdateApiRequest} request UpdateApiRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.UpdateApiCallback} callback Node-style callback called with the error, if any, and Api + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.updateApi = function updateApi(request, callback) { + return this.rpcCall(updateApi, $root.google.cloud.apigeeregistry.v1.UpdateApiRequest, $root.google.cloud.apigeeregistry.v1.Api, request, callback); + }, "name", { value: "UpdateApi" }); + + /** + * Calls UpdateApi. + * @function updateApi + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IUpdateApiRequest} request UpdateApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApi}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef DeleteApiCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteApi. + * @function deleteApi + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiRequest} request DeleteApiRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.DeleteApiCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.deleteApi = function deleteApi(request, callback) { + return this.rpcCall(deleteApi, $root.google.cloud.apigeeregistry.v1.DeleteApiRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteApi" }); + + /** + * Calls DeleteApi. + * @function deleteApi + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiRequest} request DeleteApiRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApiVersions}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef ListApiVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ListApiVersionsResponse} [response] ListApiVersionsResponse + */ + + /** + * Calls ListApiVersions. + * @function listApiVersions + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApiVersionsRequest} request ListApiVersionsRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.ListApiVersionsCallback} callback Node-style callback called with the error, if any, and ListApiVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.listApiVersions = function listApiVersions(request, callback) { + return this.rpcCall(listApiVersions, $root.google.cloud.apigeeregistry.v1.ListApiVersionsRequest, $root.google.cloud.apigeeregistry.v1.ListApiVersionsResponse, request, callback); + }, "name", { value: "ListApiVersions" }); + + /** + * Calls ListApiVersions. + * @function listApiVersions + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApiVersionsRequest} request ListApiVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getApiVersion}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef GetApiVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiVersion} [response] ApiVersion + */ + + /** + * Calls GetApiVersion. + * @function getApiVersion + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetApiVersionRequest} request GetApiVersionRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.GetApiVersionCallback} callback Node-style callback called with the error, if any, and ApiVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.getApiVersion = function getApiVersion(request, callback) { + return this.rpcCall(getApiVersion, $root.google.cloud.apigeeregistry.v1.GetApiVersionRequest, $root.google.cloud.apigeeregistry.v1.ApiVersion, request, callback); + }, "name", { value: "GetApiVersion" }); + + /** + * Calls GetApiVersion. + * @function getApiVersion + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetApiVersionRequest} request GetApiVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|createApiVersion}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef CreateApiVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiVersion} [response] ApiVersion + */ + + /** + * Calls CreateApiVersion. + * @function createApiVersion + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateApiVersionRequest} request CreateApiVersionRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.CreateApiVersionCallback} callback Node-style callback called with the error, if any, and ApiVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.createApiVersion = function createApiVersion(request, callback) { + return this.rpcCall(createApiVersion, $root.google.cloud.apigeeregistry.v1.CreateApiVersionRequest, $root.google.cloud.apigeeregistry.v1.ApiVersion, request, callback); + }, "name", { value: "CreateApiVersion" }); + + /** + * Calls CreateApiVersion. + * @function createApiVersion + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateApiVersionRequest} request CreateApiVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|updateApiVersion}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef UpdateApiVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiVersion} [response] ApiVersion + */ + + /** + * Calls UpdateApiVersion. + * @function updateApiVersion + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest} request UpdateApiVersionRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.UpdateApiVersionCallback} callback Node-style callback called with the error, if any, and ApiVersion + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.updateApiVersion = function updateApiVersion(request, callback) { + return this.rpcCall(updateApiVersion, $root.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest, $root.google.cloud.apigeeregistry.v1.ApiVersion, request, callback); + }, "name", { value: "UpdateApiVersion" }); + + /** + * Calls UpdateApiVersion. + * @function updateApiVersion + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest} request UpdateApiVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApiVersion}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef DeleteApiVersionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteApiVersion. + * @function deleteApiVersion + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest} request DeleteApiVersionRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.DeleteApiVersionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.deleteApiVersion = function deleteApiVersion(request, callback) { + return this.rpcCall(deleteApiVersion, $root.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteApiVersion" }); + + /** + * Calls DeleteApiVersion. + * @function deleteApiVersion + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest} request DeleteApiVersionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApiSpecs}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef ListApiSpecsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ListApiSpecsResponse} [response] ListApiSpecsResponse + */ + + /** + * Calls ListApiSpecs. + * @function listApiSpecs + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApiSpecsRequest} request ListApiSpecsRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.ListApiSpecsCallback} callback Node-style callback called with the error, if any, and ListApiSpecsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.listApiSpecs = function listApiSpecs(request, callback) { + return this.rpcCall(listApiSpecs, $root.google.cloud.apigeeregistry.v1.ListApiSpecsRequest, $root.google.cloud.apigeeregistry.v1.ListApiSpecsResponse, request, callback); + }, "name", { value: "ListApiSpecs" }); + + /** + * Calls ListApiSpecs. + * @function listApiSpecs + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApiSpecsRequest} request ListApiSpecsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getApiSpec}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef GetApiSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiSpec} [response] ApiSpec + */ + + /** + * Calls GetApiSpec. + * @function getApiSpec + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecRequest} request GetApiSpecRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.GetApiSpecCallback} callback Node-style callback called with the error, if any, and ApiSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.getApiSpec = function getApiSpec(request, callback) { + return this.rpcCall(getApiSpec, $root.google.cloud.apigeeregistry.v1.GetApiSpecRequest, $root.google.cloud.apigeeregistry.v1.ApiSpec, request, callback); + }, "name", { value: "GetApiSpec" }); + + /** + * Calls GetApiSpec. + * @function getApiSpec + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecRequest} request GetApiSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getApiSpecContents}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef GetApiSpecContentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.HttpBody} [response] HttpBody + */ + + /** + * Calls GetApiSpecContents. + * @function getApiSpecContents + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest} request GetApiSpecContentsRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.GetApiSpecContentsCallback} callback Node-style callback called with the error, if any, and HttpBody + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.getApiSpecContents = function getApiSpecContents(request, callback) { + return this.rpcCall(getApiSpecContents, $root.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest, $root.google.api.HttpBody, request, callback); + }, "name", { value: "GetApiSpecContents" }); + + /** + * Calls GetApiSpecContents. + * @function getApiSpecContents + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest} request GetApiSpecContentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|createApiSpec}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef CreateApiSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiSpec} [response] ApiSpec + */ + + /** + * Calls CreateApiSpec. + * @function createApiSpec + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateApiSpecRequest} request CreateApiSpecRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.CreateApiSpecCallback} callback Node-style callback called with the error, if any, and ApiSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.createApiSpec = function createApiSpec(request, callback) { + return this.rpcCall(createApiSpec, $root.google.cloud.apigeeregistry.v1.CreateApiSpecRequest, $root.google.cloud.apigeeregistry.v1.ApiSpec, request, callback); + }, "name", { value: "CreateApiSpec" }); + + /** + * Calls CreateApiSpec. + * @function createApiSpec + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateApiSpecRequest} request CreateApiSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|updateApiSpec}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef UpdateApiSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiSpec} [response] ApiSpec + */ + + /** + * Calls UpdateApiSpec. + * @function updateApiSpec + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest} request UpdateApiSpecRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.UpdateApiSpecCallback} callback Node-style callback called with the error, if any, and ApiSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.updateApiSpec = function updateApiSpec(request, callback) { + return this.rpcCall(updateApiSpec, $root.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest, $root.google.cloud.apigeeregistry.v1.ApiSpec, request, callback); + }, "name", { value: "UpdateApiSpec" }); + + /** + * Calls UpdateApiSpec. + * @function updateApiSpec + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest} request UpdateApiSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApiSpec}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef DeleteApiSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteApiSpec. + * @function deleteApiSpec + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest} request DeleteApiSpecRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.DeleteApiSpecCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.deleteApiSpec = function deleteApiSpec(request, callback) { + return this.rpcCall(deleteApiSpec, $root.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteApiSpec" }); + + /** + * Calls DeleteApiSpec. + * @function deleteApiSpec + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest} request DeleteApiSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|tagApiSpecRevision}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef TagApiSpecRevisionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiSpec} [response] ApiSpec + */ + + /** + * Calls TagApiSpecRevision. + * @function tagApiSpecRevision + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest} request TagApiSpecRevisionRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.TagApiSpecRevisionCallback} callback Node-style callback called with the error, if any, and ApiSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.tagApiSpecRevision = function tagApiSpecRevision(request, callback) { + return this.rpcCall(tagApiSpecRevision, $root.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest, $root.google.cloud.apigeeregistry.v1.ApiSpec, request, callback); + }, "name", { value: "TagApiSpecRevision" }); + + /** + * Calls TagApiSpecRevision. + * @function tagApiSpecRevision + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest} request TagApiSpecRevisionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApiSpecRevisions}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef ListApiSpecRevisionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse} [response] ListApiSpecRevisionsResponse + */ + + /** + * Calls ListApiSpecRevisions. + * @function listApiSpecRevisions + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest} request ListApiSpecRevisionsRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.ListApiSpecRevisionsCallback} callback Node-style callback called with the error, if any, and ListApiSpecRevisionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.listApiSpecRevisions = function listApiSpecRevisions(request, callback) { + return this.rpcCall(listApiSpecRevisions, $root.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest, $root.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse, request, callback); + }, "name", { value: "ListApiSpecRevisions" }); + + /** + * Calls ListApiSpecRevisions. + * @function listApiSpecRevisions + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest} request ListApiSpecRevisionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|rollbackApiSpec}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef RollbackApiSpecCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiSpec} [response] ApiSpec + */ + + /** + * Calls RollbackApiSpec. + * @function rollbackApiSpec + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest} request RollbackApiSpecRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.RollbackApiSpecCallback} callback Node-style callback called with the error, if any, and ApiSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.rollbackApiSpec = function rollbackApiSpec(request, callback) { + return this.rpcCall(rollbackApiSpec, $root.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest, $root.google.cloud.apigeeregistry.v1.ApiSpec, request, callback); + }, "name", { value: "RollbackApiSpec" }); + + /** + * Calls RollbackApiSpec. + * @function rollbackApiSpec + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest} request RollbackApiSpecRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApiSpecRevision}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef DeleteApiSpecRevisionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiSpec} [response] ApiSpec + */ + + /** + * Calls DeleteApiSpecRevision. + * @function deleteApiSpecRevision + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest} request DeleteApiSpecRevisionRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.DeleteApiSpecRevisionCallback} callback Node-style callback called with the error, if any, and ApiSpec + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.deleteApiSpecRevision = function deleteApiSpecRevision(request, callback) { + return this.rpcCall(deleteApiSpecRevision, $root.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest, $root.google.cloud.apigeeregistry.v1.ApiSpec, request, callback); + }, "name", { value: "DeleteApiSpecRevision" }); + + /** + * Calls DeleteApiSpecRevision. + * @function deleteApiSpecRevision + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest} request DeleteApiSpecRevisionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApiDeployments}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef ListApiDeploymentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse} [response] ListApiDeploymentsResponse + */ + + /** + * Calls ListApiDeployments. + * @function listApiDeployments + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest} request ListApiDeploymentsRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.ListApiDeploymentsCallback} callback Node-style callback called with the error, if any, and ListApiDeploymentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.listApiDeployments = function listApiDeployments(request, callback) { + return this.rpcCall(listApiDeployments, $root.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest, $root.google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse, request, callback); + }, "name", { value: "ListApiDeployments" }); + + /** + * Calls ListApiDeployments. + * @function listApiDeployments + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest} request ListApiDeploymentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getApiDeployment}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef GetApiDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiDeployment} [response] ApiDeployment + */ + + /** + * Calls GetApiDeployment. + * @function getApiDeployment + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest} request GetApiDeploymentRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.GetApiDeploymentCallback} callback Node-style callback called with the error, if any, and ApiDeployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.getApiDeployment = function getApiDeployment(request, callback) { + return this.rpcCall(getApiDeployment, $root.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest, $root.google.cloud.apigeeregistry.v1.ApiDeployment, request, callback); + }, "name", { value: "GetApiDeployment" }); + + /** + * Calls GetApiDeployment. + * @function getApiDeployment + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest} request GetApiDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|createApiDeployment}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef CreateApiDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiDeployment} [response] ApiDeployment + */ + + /** + * Calls CreateApiDeployment. + * @function createApiDeployment + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest} request CreateApiDeploymentRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.CreateApiDeploymentCallback} callback Node-style callback called with the error, if any, and ApiDeployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.createApiDeployment = function createApiDeployment(request, callback) { + return this.rpcCall(createApiDeployment, $root.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest, $root.google.cloud.apigeeregistry.v1.ApiDeployment, request, callback); + }, "name", { value: "CreateApiDeployment" }); + + /** + * Calls CreateApiDeployment. + * @function createApiDeployment + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest} request CreateApiDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|updateApiDeployment}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef UpdateApiDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiDeployment} [response] ApiDeployment + */ + + /** + * Calls UpdateApiDeployment. + * @function updateApiDeployment + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest} request UpdateApiDeploymentRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.UpdateApiDeploymentCallback} callback Node-style callback called with the error, if any, and ApiDeployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.updateApiDeployment = function updateApiDeployment(request, callback) { + return this.rpcCall(updateApiDeployment, $root.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest, $root.google.cloud.apigeeregistry.v1.ApiDeployment, request, callback); + }, "name", { value: "UpdateApiDeployment" }); + + /** + * Calls UpdateApiDeployment. + * @function updateApiDeployment + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest} request UpdateApiDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApiDeployment}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef DeleteApiDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteApiDeployment. + * @function deleteApiDeployment + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest} request DeleteApiDeploymentRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.DeleteApiDeploymentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.deleteApiDeployment = function deleteApiDeployment(request, callback) { + return this.rpcCall(deleteApiDeployment, $root.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteApiDeployment" }); + + /** + * Calls DeleteApiDeployment. + * @function deleteApiDeployment + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest} request DeleteApiDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|tagApiDeploymentRevision}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef TagApiDeploymentRevisionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiDeployment} [response] ApiDeployment + */ + + /** + * Calls TagApiDeploymentRevision. + * @function tagApiDeploymentRevision + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest} request TagApiDeploymentRevisionRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.TagApiDeploymentRevisionCallback} callback Node-style callback called with the error, if any, and ApiDeployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.tagApiDeploymentRevision = function tagApiDeploymentRevision(request, callback) { + return this.rpcCall(tagApiDeploymentRevision, $root.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest, $root.google.cloud.apigeeregistry.v1.ApiDeployment, request, callback); + }, "name", { value: "TagApiDeploymentRevision" }); + + /** + * Calls TagApiDeploymentRevision. + * @function tagApiDeploymentRevision + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest} request TagApiDeploymentRevisionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listApiDeploymentRevisions}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef ListApiDeploymentRevisionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse} [response] ListApiDeploymentRevisionsResponse + */ + + /** + * Calls ListApiDeploymentRevisions. + * @function listApiDeploymentRevisions + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest} request ListApiDeploymentRevisionsRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.ListApiDeploymentRevisionsCallback} callback Node-style callback called with the error, if any, and ListApiDeploymentRevisionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.listApiDeploymentRevisions = function listApiDeploymentRevisions(request, callback) { + return this.rpcCall(listApiDeploymentRevisions, $root.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest, $root.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse, request, callback); + }, "name", { value: "ListApiDeploymentRevisions" }); + + /** + * Calls ListApiDeploymentRevisions. + * @function listApiDeploymentRevisions + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest} request ListApiDeploymentRevisionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|rollbackApiDeployment}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef RollbackApiDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiDeployment} [response] ApiDeployment + */ + + /** + * Calls RollbackApiDeployment. + * @function rollbackApiDeployment + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest} request RollbackApiDeploymentRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.RollbackApiDeploymentCallback} callback Node-style callback called with the error, if any, and ApiDeployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.rollbackApiDeployment = function rollbackApiDeployment(request, callback) { + return this.rpcCall(rollbackApiDeployment, $root.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest, $root.google.cloud.apigeeregistry.v1.ApiDeployment, request, callback); + }, "name", { value: "RollbackApiDeployment" }); + + /** + * Calls RollbackApiDeployment. + * @function rollbackApiDeployment + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest} request RollbackApiDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteApiDeploymentRevision}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef DeleteApiDeploymentRevisionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ApiDeployment} [response] ApiDeployment + */ + + /** + * Calls DeleteApiDeploymentRevision. + * @function deleteApiDeploymentRevision + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest} request DeleteApiDeploymentRevisionRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.DeleteApiDeploymentRevisionCallback} callback Node-style callback called with the error, if any, and ApiDeployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.deleteApiDeploymentRevision = function deleteApiDeploymentRevision(request, callback) { + return this.rpcCall(deleteApiDeploymentRevision, $root.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest, $root.google.cloud.apigeeregistry.v1.ApiDeployment, request, callback); + }, "name", { value: "DeleteApiDeploymentRevision" }); + + /** + * Calls DeleteApiDeploymentRevision. + * @function deleteApiDeploymentRevision + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest} request DeleteApiDeploymentRevisionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|listArtifacts}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef ListArtifactsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.ListArtifactsResponse} [response] ListArtifactsResponse + */ + + /** + * Calls ListArtifacts. + * @function listArtifacts + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListArtifactsRequest} request ListArtifactsRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.ListArtifactsCallback} callback Node-style callback called with the error, if any, and ListArtifactsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.listArtifacts = function listArtifacts(request, callback) { + return this.rpcCall(listArtifacts, $root.google.cloud.apigeeregistry.v1.ListArtifactsRequest, $root.google.cloud.apigeeregistry.v1.ListArtifactsResponse, request, callback); + }, "name", { value: "ListArtifacts" }); + + /** + * Calls ListArtifacts. + * @function listArtifacts + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IListArtifactsRequest} request ListArtifactsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getArtifact}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef GetArtifactCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.Artifact} [response] Artifact + */ + + /** + * Calls GetArtifact. + * @function getArtifact + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetArtifactRequest} request GetArtifactRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.GetArtifactCallback} callback Node-style callback called with the error, if any, and Artifact + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.getArtifact = function getArtifact(request, callback) { + return this.rpcCall(getArtifact, $root.google.cloud.apigeeregistry.v1.GetArtifactRequest, $root.google.cloud.apigeeregistry.v1.Artifact, request, callback); + }, "name", { value: "GetArtifact" }); + + /** + * Calls GetArtifact. + * @function getArtifact + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetArtifactRequest} request GetArtifactRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|getArtifactContents}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef GetArtifactContentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.HttpBody} [response] HttpBody + */ + + /** + * Calls GetArtifactContents. + * @function getArtifactContents + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest} request GetArtifactContentsRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.GetArtifactContentsCallback} callback Node-style callback called with the error, if any, and HttpBody + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.getArtifactContents = function getArtifactContents(request, callback) { + return this.rpcCall(getArtifactContents, $root.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest, $root.google.api.HttpBody, request, callback); + }, "name", { value: "GetArtifactContents" }); + + /** + * Calls GetArtifactContents. + * @function getArtifactContents + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest} request GetArtifactContentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|createArtifact}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef CreateArtifactCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.Artifact} [response] Artifact + */ + + /** + * Calls CreateArtifact. + * @function createArtifact + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateArtifactRequest} request CreateArtifactRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.CreateArtifactCallback} callback Node-style callback called with the error, if any, and Artifact + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.createArtifact = function createArtifact(request, callback) { + return this.rpcCall(createArtifact, $root.google.cloud.apigeeregistry.v1.CreateArtifactRequest, $root.google.cloud.apigeeregistry.v1.Artifact, request, callback); + }, "name", { value: "CreateArtifact" }); + + /** + * Calls CreateArtifact. + * @function createArtifact + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.ICreateArtifactRequest} request CreateArtifactRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|replaceArtifact}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef ReplaceArtifactCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.apigeeregistry.v1.Artifact} [response] Artifact + */ + + /** + * Calls ReplaceArtifact. + * @function replaceArtifact + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IReplaceArtifactRequest} request ReplaceArtifactRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.ReplaceArtifactCallback} callback Node-style callback called with the error, if any, and Artifact + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.replaceArtifact = function replaceArtifact(request, callback) { + return this.rpcCall(replaceArtifact, $root.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest, $root.google.cloud.apigeeregistry.v1.Artifact, request, callback); + }, "name", { value: "ReplaceArtifact" }); + + /** + * Calls ReplaceArtifact. + * @function replaceArtifact + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IReplaceArtifactRequest} request ReplaceArtifactRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.apigeeregistry.v1.Registry|deleteArtifact}. + * @memberof google.cloud.apigeeregistry.v1.Registry + * @typedef DeleteArtifactCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteArtifact. + * @function deleteArtifact + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteArtifactRequest} request DeleteArtifactRequest message or plain object + * @param {google.cloud.apigeeregistry.v1.Registry.DeleteArtifactCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Registry.prototype.deleteArtifact = function deleteArtifact(request, callback) { + return this.rpcCall(deleteArtifact, $root.google.cloud.apigeeregistry.v1.DeleteArtifactRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteArtifact" }); + + /** + * Calls DeleteArtifact. + * @function deleteArtifact + * @memberof google.cloud.apigeeregistry.v1.Registry + * @instance + * @param {google.cloud.apigeeregistry.v1.IDeleteArtifactRequest} request DeleteArtifactRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Registry; + })(); + + v1.ListApisRequest = (function() { + + /** + * Properties of a ListApisRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApisRequest + * @property {string|null} [parent] ListApisRequest parent + * @property {number|null} [pageSize] ListApisRequest pageSize + * @property {string|null} [pageToken] ListApisRequest pageToken + * @property {string|null} [filter] ListApisRequest filter + */ + + /** + * Constructs a new ListApisRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApisRequest. + * @implements IListApisRequest + * @constructor + * @param {google.cloud.apigeeregistry.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.apigeeregistry.v1.ListApisRequest + * @instance + */ + ListApisRequest.prototype.parent = ""; + + /** + * ListApisRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @instance + */ + ListApisRequest.prototype.pageSize = 0; + + /** + * ListApisRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @instance + */ + ListApisRequest.prototype.pageToken = ""; + + /** + * ListApisRequest filter. + * @member {string} filter + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @instance + */ + ListApisRequest.prototype.filter = ""; + + /** + * Creates a new ListApisRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApisRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApisRequest} ListApisRequest instance + */ + ListApisRequest.create = function create(properties) { + return new ListApisRequest(properties); + }; + + /** + * Encodes the specified ListApisRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApisRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @static + * @param {google.cloud.apigeeregistry.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.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListApisRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApisRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @static + * @param {google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.v1.ListApisRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApisRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.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.apigeeregistry.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.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListApisRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApisRequest} ListApisRequest + */ + ListApisRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApisRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApisRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListApisRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApisRequest + * @static + * @param {google.cloud.apigeeregistry.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.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListApisRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.v1.ListApisRequest"; + }; + + return ListApisRequest; + })(); + + v1.ListApisResponse = (function() { + + /** + * Properties of a ListApisResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApisResponse + * @property {Array.|null} [apis] ListApisResponse apis + * @property {string|null} [nextPageToken] ListApisResponse nextPageToken + */ + + /** + * Constructs a new ListApisResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApisResponse. + * @implements IListApisResponse + * @constructor + * @param {google.cloud.apigeeregistry.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.apigeeregistry.v1.ListApisResponse + * @instance + */ + ListApisResponse.prototype.apis = $util.emptyArray; + + /** + * ListApisResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apigeeregistry.v1.ListApisResponse + * @instance + */ + ListApisResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListApisResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApisResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApisResponse=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApisResponse} ListApisResponse instance + */ + ListApisResponse.create = function create(properties) { + return new ListApisResponse(properties); + }; + + /** + * Encodes the specified ListApisResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApisResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApisResponse + * @static + * @param {google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.v1.ListApisResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApisResponse + * @static + * @param {google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.v1.ListApisResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.v1.ListApisResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApisResponse} ListApisResponse + */ + ListApisResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApisResponse) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApisResponse(); + if (object.apis) { + if (!Array.isArray(object.apis)) + throw TypeError(".google.cloud.apigeeregistry.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.apigeeregistry.v1.ListApisResponse.apis: object expected"); + message.apis[i] = $root.google.cloud.apigeeregistry.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.apigeeregistry.v1.ListApisResponse + * @static + * @param {google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.v1.ListApisResponse"; + }; + + return ListApisResponse; + })(); + + v1.GetApiRequest = (function() { + + /** + * Properties of a GetApiRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IGetApiRequest + * @property {string|null} [name] GetApiRequest name + */ + + /** + * Constructs a new GetApiRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a GetApiRequest. + * @implements IGetApiRequest + * @constructor + * @param {google.cloud.apigeeregistry.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.apigeeregistry.v1.GetApiRequest + * @instance + */ + GetApiRequest.prototype.name = ""; + + /** + * Creates a new GetApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.GetApiRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.GetApiRequest} GetApiRequest instance + */ + GetApiRequest.create = function create(properties) { + return new GetApiRequest(properties); + }; + + /** + * Encodes the specified GetApiRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.GetApiRequest + * @static + * @param {google.cloud.apigeeregistry.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.apigeeregistry.v1.GetApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetApiRequest + * @static + * @param {google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.v1.GetApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.v1.GetApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.GetApiRequest} GetApiRequest + */ + GetApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.GetApiRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.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.apigeeregistry.v1.GetApiRequest + * @static + * @param {google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.v1.GetApiRequest"; + }; + + return GetApiRequest; + })(); + + v1.CreateApiRequest = (function() { + + /** + * Properties of a CreateApiRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface ICreateApiRequest + * @property {string|null} [parent] CreateApiRequest parent + * @property {google.cloud.apigeeregistry.v1.IApi|null} [api] CreateApiRequest api + * @property {string|null} [apiId] CreateApiRequest apiId + */ + + /** + * Constructs a new CreateApiRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a CreateApiRequest. + * @implements ICreateApiRequest + * @constructor + * @param {google.cloud.apigeeregistry.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.apigeeregistry.v1.CreateApiRequest + * @instance + */ + CreateApiRequest.prototype.parent = ""; + + /** + * CreateApiRequest api. + * @member {google.cloud.apigeeregistry.v1.IApi|null|undefined} api + * @memberof google.cloud.apigeeregistry.v1.CreateApiRequest + * @instance + */ + CreateApiRequest.prototype.api = null; + + /** + * CreateApiRequest apiId. + * @member {string} apiId + * @memberof google.cloud.apigeeregistry.v1.CreateApiRequest + * @instance + */ + CreateApiRequest.prototype.apiId = ""; + + /** + * Creates a new CreateApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.CreateApiRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateApiRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.CreateApiRequest} CreateApiRequest instance + */ + CreateApiRequest.create = function create(properties) { + return new CreateApiRequest(properties); + }; + + /** + * Encodes the specified CreateApiRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.CreateApiRequest + * @static + * @param {google.cloud.apigeeregistry.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.api != null && Object.hasOwnProperty.call(message, "api")) + $root.google.cloud.apigeeregistry.v1.Api.encode(message.api, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.apiId != null && Object.hasOwnProperty.call(message, "apiId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.apiId); + return writer; + }; + + /** + * Encodes the specified CreateApiRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateApiRequest + * @static + * @param {google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.v1.CreateApiRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.api = $root.google.cloud.apigeeregistry.v1.Api.decode(reader, reader.uint32()); + break; + } + case 3: { + message.apiId = reader.string(); + 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.apigeeregistry.v1.CreateApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.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.apigeeregistry.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.api != null && message.hasOwnProperty("api")) { + var error = $root.google.cloud.apigeeregistry.v1.Api.verify(message.api); + if (error) + return "api." + error; + } + if (message.apiId != null && message.hasOwnProperty("apiId")) + if (!$util.isString(message.apiId)) + return "apiId: string expected"; + return null; + }; + + /** + * Creates a CreateApiRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.CreateApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.CreateApiRequest} CreateApiRequest + */ + CreateApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.CreateApiRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.CreateApiRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.api != null) { + if (typeof object.api !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.CreateApiRequest.api: object expected"); + message.api = $root.google.cloud.apigeeregistry.v1.Api.fromObject(object.api); + } + if (object.apiId != null) + message.apiId = String(object.apiId); + return message; + }; + + /** + * Creates a plain object from a CreateApiRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.CreateApiRequest + * @static + * @param {google.cloud.apigeeregistry.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.api = null; + object.apiId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.api != null && message.hasOwnProperty("api")) + object.api = $root.google.cloud.apigeeregistry.v1.Api.toObject(message.api, options); + if (message.apiId != null && message.hasOwnProperty("apiId")) + object.apiId = message.apiId; + return object; + }; + + /** + * Converts this CreateApiRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.v1.CreateApiRequest"; + }; + + return CreateApiRequest; + })(); + + v1.UpdateApiRequest = (function() { + + /** + * Properties of an UpdateApiRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IUpdateApiRequest + * @property {google.cloud.apigeeregistry.v1.IApi|null} [api] UpdateApiRequest api + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateApiRequest updateMask + * @property {boolean|null} [allowMissing] UpdateApiRequest allowMissing + */ + + /** + * Constructs a new UpdateApiRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents an UpdateApiRequest. + * @implements IUpdateApiRequest + * @constructor + * @param {google.cloud.apigeeregistry.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.apigeeregistry.v1.IApi|null|undefined} api + * @memberof google.cloud.apigeeregistry.v1.UpdateApiRequest + * @instance + */ + UpdateApiRequest.prototype.api = null; + + /** + * UpdateApiRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apigeeregistry.v1.UpdateApiRequest + * @instance + */ + UpdateApiRequest.prototype.updateMask = null; + + /** + * UpdateApiRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.apigeeregistry.v1.UpdateApiRequest + * @instance + */ + UpdateApiRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.UpdateApiRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IUpdateApiRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.UpdateApiRequest} UpdateApiRequest instance + */ + UpdateApiRequest.create = function create(properties) { + return new UpdateApiRequest(properties); + }; + + /** + * Encodes the specified UpdateApiRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.UpdateApiRequest + * @static + * @param {google.cloud.apigeeregistry.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.apigeeregistry.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(); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateApiRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.UpdateApiRequest + * @static + * @param {google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.v1.UpdateApiRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.api = $root.google.cloud.apigeeregistry.v1.Api.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.allowMissing = reader.bool(); + 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.apigeeregistry.v1.UpdateApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateApiRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.UpdateApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.UpdateApiRequest} UpdateApiRequest + */ + UpdateApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.UpdateApiRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.UpdateApiRequest(); + if (object.api != null) { + if (typeof object.api !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.UpdateApiRequest.api: object expected"); + message.api = $root.google.cloud.apigeeregistry.v1.Api.fromObject(object.api); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.UpdateApiRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateApiRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.UpdateApiRequest + * @static + * @param {google.cloud.apigeeregistry.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; + object.allowMissing = false; + } + if (message.api != null && message.hasOwnProperty("api")) + object.api = $root.google.cloud.apigeeregistry.v1.Api.toObject(message.api, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateApiRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.v1.UpdateApiRequest"; + }; + + return UpdateApiRequest; + })(); + + v1.DeleteApiRequest = (function() { + + /** + * Properties of a DeleteApiRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IDeleteApiRequest + * @property {string|null} [name] DeleteApiRequest name + * @property {boolean|null} [force] DeleteApiRequest force + */ + + /** + * Constructs a new DeleteApiRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a DeleteApiRequest. + * @implements IDeleteApiRequest + * @constructor + * @param {google.cloud.apigeeregistry.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.apigeeregistry.v1.DeleteApiRequest + * @instance + */ + DeleteApiRequest.prototype.name = ""; + + /** + * DeleteApiRequest force. + * @member {boolean} force + * @memberof google.cloud.apigeeregistry.v1.DeleteApiRequest + * @instance + */ + DeleteApiRequest.prototype.force = false; + + /** + * Creates a new DeleteApiRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.DeleteApiRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.DeleteApiRequest} DeleteApiRequest instance + */ + DeleteApiRequest.create = function create(properties) { + return new DeleteApiRequest(properties); + }; + + /** + * Encodes the specified DeleteApiRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiRequest + * @static + * @param {google.cloud.apigeeregistry.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.apigeeregistry.v1.DeleteApiRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiRequest + * @static + * @param {google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.v1.DeleteApiRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.v1.DeleteApiRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.DeleteApiRequest} DeleteApiRequest + */ + DeleteApiRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.DeleteApiRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.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.apigeeregistry.v1.DeleteApiRequest + * @static + * @param {google.cloud.apigeeregistry.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.apigeeregistry.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.apigeeregistry.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.apigeeregistry.v1.DeleteApiRequest"; + }; + + return DeleteApiRequest; + })(); + + v1.ListApiVersionsRequest = (function() { + + /** + * Properties of a ListApiVersionsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApiVersionsRequest + * @property {string|null} [parent] ListApiVersionsRequest parent + * @property {number|null} [pageSize] ListApiVersionsRequest pageSize + * @property {string|null} [pageToken] ListApiVersionsRequest pageToken + * @property {string|null} [filter] ListApiVersionsRequest filter + */ + + /** + * Constructs a new ListApiVersionsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApiVersionsRequest. + * @implements IListApiVersionsRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListApiVersionsRequest=} [properties] Properties to set + */ + function ListApiVersionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApiVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @instance + */ + ListApiVersionsRequest.prototype.parent = ""; + + /** + * ListApiVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @instance + */ + ListApiVersionsRequest.prototype.pageSize = 0; + + /** + * ListApiVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @instance + */ + ListApiVersionsRequest.prototype.pageToken = ""; + + /** + * ListApiVersionsRequest filter. + * @member {string} filter + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @instance + */ + ListApiVersionsRequest.prototype.filter = ""; + + /** + * Creates a new ListApiVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApiVersionsRequest} ListApiVersionsRequest instance + */ + ListApiVersionsRequest.create = function create(properties) { + return new ListApiVersionsRequest(properties); + }; + + /** + * Encodes the specified ListApiVersionsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiVersionsRequest} message ListApiVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiVersionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListApiVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiVersionsRequest} message ListApiVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListApiVersionsRequest} ListApiVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiVersionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListApiVersionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApiVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListApiVersionsRequest} ListApiVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiVersionsRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiVersionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListApiVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApiVersionsRequest} ListApiVersionsRequest + */ + ListApiVersionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApiVersionsRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApiVersionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListApiVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ListApiVersionsRequest} message ListApiVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiVersionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListApiVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListApiVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListApiVersionsRequest"; + }; + + return ListApiVersionsRequest; + })(); + + v1.ListApiVersionsResponse = (function() { + + /** + * Properties of a ListApiVersionsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApiVersionsResponse + * @property {Array.|null} [apiVersions] ListApiVersionsResponse apiVersions + * @property {string|null} [nextPageToken] ListApiVersionsResponse nextPageToken + */ + + /** + * Constructs a new ListApiVersionsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApiVersionsResponse. + * @implements IListApiVersionsResponse + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListApiVersionsResponse=} [properties] Properties to set + */ + function ListApiVersionsResponse(properties) { + this.apiVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApiVersionsResponse apiVersions. + * @member {Array.} apiVersions + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @instance + */ + ListApiVersionsResponse.prototype.apiVersions = $util.emptyArray; + + /** + * ListApiVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @instance + */ + ListApiVersionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListApiVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApiVersionsResponse} ListApiVersionsResponse instance + */ + ListApiVersionsResponse.create = function create(properties) { + return new ListApiVersionsResponse(properties); + }; + + /** + * Encodes the specified ListApiVersionsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiVersionsResponse} message ListApiVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiVersions != null && message.apiVersions.length) + for (var i = 0; i < message.apiVersions.length; ++i) + $root.google.cloud.apigeeregistry.v1.ApiVersion.encode(message.apiVersions[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 ListApiVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiVersionsResponse} message ListApiVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListApiVersionsResponse} ListApiVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiVersionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListApiVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.apiVersions && message.apiVersions.length)) + message.apiVersions = []; + message.apiVersions.push($root.google.cloud.apigeeregistry.v1.ApiVersion.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApiVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListApiVersionsResponse} ListApiVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiVersionsResponse message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiVersionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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) { + var error = $root.google.cloud.apigeeregistry.v1.ApiVersion.verify(message.apiVersions[i]); + if (error) + return "apiVersions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListApiVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApiVersionsResponse} ListApiVersionsResponse + */ + ListApiVersionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApiVersionsResponse) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApiVersionsResponse(); + if (object.apiVersions) { + if (!Array.isArray(object.apiVersions)) + throw TypeError(".google.cloud.apigeeregistry.v1.ListApiVersionsResponse.apiVersions: array expected"); + message.apiVersions = []; + for (var i = 0; i < object.apiVersions.length; ++i) { + if (typeof object.apiVersions[i] !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ListApiVersionsResponse.apiVersions: object expected"); + message.apiVersions[i] = $root.google.cloud.apigeeregistry.v1.ApiVersion.fromObject(object.apiVersions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListApiVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.ListApiVersionsResponse} message ListApiVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.apiVersions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.apiVersions && message.apiVersions.length) { + object.apiVersions = []; + for (var j = 0; j < message.apiVersions.length; ++j) + object.apiVersions[j] = $root.google.cloud.apigeeregistry.v1.ApiVersion.toObject(message.apiVersions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListApiVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListApiVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListApiVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListApiVersionsResponse"; + }; + + return ListApiVersionsResponse; + })(); + + v1.GetApiVersionRequest = (function() { + + /** + * Properties of a GetApiVersionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IGetApiVersionRequest + * @property {string|null} [name] GetApiVersionRequest name + */ + + /** + * Constructs a new GetApiVersionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a GetApiVersionRequest. + * @implements IGetApiVersionRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IGetApiVersionRequest=} [properties] Properties to set + */ + function GetApiVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetApiVersionRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.GetApiVersionRequest + * @instance + */ + GetApiVersionRequest.prototype.name = ""; + + /** + * Creates a new GetApiVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.GetApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiVersionRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.GetApiVersionRequest} GetApiVersionRequest instance + */ + GetApiVersionRequest.create = function create(properties) { + return new GetApiVersionRequest(properties); + }; + + /** + * Encodes the specified GetApiVersionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.GetApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiVersionRequest} message GetApiVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiVersionRequest.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 GetApiVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiVersionRequest} message GetApiVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetApiVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.GetApiVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.GetApiVersionRequest} GetApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiVersionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.GetApiVersionRequest(); + 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 GetApiVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetApiVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.GetApiVersionRequest} GetApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetApiVersionRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.GetApiVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetApiVersionRequest.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 GetApiVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.GetApiVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.GetApiVersionRequest} GetApiVersionRequest + */ + GetApiVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.GetApiVersionRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.GetApiVersionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetApiVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.GetApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.GetApiVersionRequest} message GetApiVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetApiVersionRequest.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 GetApiVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.GetApiVersionRequest + * @instance + * @returns {Object.} JSON object + */ + GetApiVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetApiVersionRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.GetApiVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetApiVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.GetApiVersionRequest"; + }; + + return GetApiVersionRequest; + })(); + + v1.CreateApiVersionRequest = (function() { + + /** + * Properties of a CreateApiVersionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface ICreateApiVersionRequest + * @property {string|null} [parent] CreateApiVersionRequest parent + * @property {google.cloud.apigeeregistry.v1.IApiVersion|null} [apiVersion] CreateApiVersionRequest apiVersion + * @property {string|null} [apiVersionId] CreateApiVersionRequest apiVersionId + */ + + /** + * Constructs a new CreateApiVersionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a CreateApiVersionRequest. + * @implements ICreateApiVersionRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.ICreateApiVersionRequest=} [properties] Properties to set + */ + function CreateApiVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateApiVersionRequest parent. + * @member {string} parent + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @instance + */ + CreateApiVersionRequest.prototype.parent = ""; + + /** + * CreateApiVersionRequest apiVersion. + * @member {google.cloud.apigeeregistry.v1.IApiVersion|null|undefined} apiVersion + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @instance + */ + CreateApiVersionRequest.prototype.apiVersion = null; + + /** + * CreateApiVersionRequest apiVersionId. + * @member {string} apiVersionId + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @instance + */ + CreateApiVersionRequest.prototype.apiVersionId = ""; + + /** + * Creates a new CreateApiVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateApiVersionRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.CreateApiVersionRequest} CreateApiVersionRequest instance + */ + CreateApiVersionRequest.create = function create(properties) { + return new CreateApiVersionRequest(properties); + }; + + /** + * Encodes the specified CreateApiVersionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateApiVersionRequest} message CreateApiVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApiVersionRequest.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.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + $root.google.cloud.apigeeregistry.v1.ApiVersion.encode(message.apiVersion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.apiVersionId != null && Object.hasOwnProperty.call(message, "apiVersionId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.apiVersionId); + return writer; + }; + + /** + * Encodes the specified CreateApiVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateApiVersionRequest} message CreateApiVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApiVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateApiVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.CreateApiVersionRequest} CreateApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApiVersionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.CreateApiVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.apiVersion = $root.google.cloud.apigeeregistry.v1.ApiVersion.decode(reader, reader.uint32()); + break; + } + case 3: { + message.apiVersionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateApiVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.CreateApiVersionRequest} CreateApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApiVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateApiVersionRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateApiVersionRequest.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.apiVersion != null && message.hasOwnProperty("apiVersion")) { + var error = $root.google.cloud.apigeeregistry.v1.ApiVersion.verify(message.apiVersion); + if (error) + return "apiVersion." + error; + } + if (message.apiVersionId != null && message.hasOwnProperty("apiVersionId")) + if (!$util.isString(message.apiVersionId)) + return "apiVersionId: string expected"; + return null; + }; + + /** + * Creates a CreateApiVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.CreateApiVersionRequest} CreateApiVersionRequest + */ + CreateApiVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.CreateApiVersionRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.CreateApiVersionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.apiVersion != null) { + if (typeof object.apiVersion !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.CreateApiVersionRequest.apiVersion: object expected"); + message.apiVersion = $root.google.cloud.apigeeregistry.v1.ApiVersion.fromObject(object.apiVersion); + } + if (object.apiVersionId != null) + message.apiVersionId = String(object.apiVersionId); + return message; + }; + + /** + * Creates a plain object from a CreateApiVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.CreateApiVersionRequest} message CreateApiVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateApiVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.apiVersion = null; + object.apiVersionId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = $root.google.cloud.apigeeregistry.v1.ApiVersion.toObject(message.apiVersion, options); + if (message.apiVersionId != null && message.hasOwnProperty("apiVersionId")) + object.apiVersionId = message.apiVersionId; + return object; + }; + + /** + * Converts this CreateApiVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateApiVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateApiVersionRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.CreateApiVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateApiVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.CreateApiVersionRequest"; + }; + + return CreateApiVersionRequest; + })(); + + v1.UpdateApiVersionRequest = (function() { + + /** + * Properties of an UpdateApiVersionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IUpdateApiVersionRequest + * @property {google.cloud.apigeeregistry.v1.IApiVersion|null} [apiVersion] UpdateApiVersionRequest apiVersion + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateApiVersionRequest updateMask + * @property {boolean|null} [allowMissing] UpdateApiVersionRequest allowMissing + */ + + /** + * Constructs a new UpdateApiVersionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents an UpdateApiVersionRequest. + * @implements IUpdateApiVersionRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest=} [properties] Properties to set + */ + function UpdateApiVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateApiVersionRequest apiVersion. + * @member {google.cloud.apigeeregistry.v1.IApiVersion|null|undefined} apiVersion + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @instance + */ + UpdateApiVersionRequest.prototype.apiVersion = null; + + /** + * UpdateApiVersionRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @instance + */ + UpdateApiVersionRequest.prototype.updateMask = null; + + /** + * UpdateApiVersionRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @instance + */ + UpdateApiVersionRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateApiVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.UpdateApiVersionRequest} UpdateApiVersionRequest instance + */ + UpdateApiVersionRequest.create = function create(properties) { + return new UpdateApiVersionRequest(properties); + }; + + /** + * Encodes the specified UpdateApiVersionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest} message UpdateApiVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApiVersionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + $root.google.cloud.apigeeregistry.v1.ApiVersion.encode(message.apiVersion, 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(); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateApiVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest} message UpdateApiVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApiVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateApiVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.UpdateApiVersionRequest} UpdateApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApiVersionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.apiVersion = $root.google.cloud.apigeeregistry.v1.ApiVersion.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateApiVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.UpdateApiVersionRequest} UpdateApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApiVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateApiVersionRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateApiVersionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) { + var error = $root.google.cloud.apigeeregistry.v1.ApiVersion.verify(message.apiVersion); + if (error) + return "apiVersion." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateApiVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.UpdateApiVersionRequest} UpdateApiVersionRequest + */ + UpdateApiVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest(); + if (object.apiVersion != null) { + if (typeof object.apiVersion !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.UpdateApiVersionRequest.apiVersion: object expected"); + message.apiVersion = $root.google.cloud.apigeeregistry.v1.ApiVersion.fromObject(object.apiVersion); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.UpdateApiVersionRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateApiVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.UpdateApiVersionRequest} message UpdateApiVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateApiVersionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.apiVersion = null; + object.updateMask = null; + object.allowMissing = false; + } + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = $root.google.cloud.apigeeregistry.v1.ApiVersion.toObject(message.apiVersion, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateApiVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateApiVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateApiVersionRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.UpdateApiVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateApiVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.UpdateApiVersionRequest"; + }; + + return UpdateApiVersionRequest; + })(); + + v1.DeleteApiVersionRequest = (function() { + + /** + * Properties of a DeleteApiVersionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IDeleteApiVersionRequest + * @property {string|null} [name] DeleteApiVersionRequest name + * @property {boolean|null} [force] DeleteApiVersionRequest force + */ + + /** + * Constructs a new DeleteApiVersionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a DeleteApiVersionRequest. + * @implements IDeleteApiVersionRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest=} [properties] Properties to set + */ + function DeleteApiVersionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteApiVersionRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @instance + */ + DeleteApiVersionRequest.prototype.name = ""; + + /** + * DeleteApiVersionRequest force. + * @member {boolean} force + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @instance + */ + DeleteApiVersionRequest.prototype.force = false; + + /** + * Creates a new DeleteApiVersionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.DeleteApiVersionRequest} DeleteApiVersionRequest instance + */ + DeleteApiVersionRequest.create = function create(properties) { + return new DeleteApiVersionRequest(properties); + }; + + /** + * Encodes the specified DeleteApiVersionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiVersionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest} message DeleteApiVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiVersionRequest.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 DeleteApiVersionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiVersionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest} message DeleteApiVersionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiVersionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteApiVersionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.DeleteApiVersionRequest} DeleteApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiVersionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest(); + 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 DeleteApiVersionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.DeleteApiVersionRequest} DeleteApiVersionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiVersionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteApiVersionRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteApiVersionRequest.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 DeleteApiVersionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.DeleteApiVersionRequest} DeleteApiVersionRequest + */ + DeleteApiVersionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest(); + 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 DeleteApiVersionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.DeleteApiVersionRequest} message DeleteApiVersionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteApiVersionRequest.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 DeleteApiVersionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteApiVersionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteApiVersionRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.DeleteApiVersionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteApiVersionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.DeleteApiVersionRequest"; + }; + + return DeleteApiVersionRequest; + })(); + + v1.ListApiSpecsRequest = (function() { + + /** + * Properties of a ListApiSpecsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApiSpecsRequest + * @property {string|null} [parent] ListApiSpecsRequest parent + * @property {number|null} [pageSize] ListApiSpecsRequest pageSize + * @property {string|null} [pageToken] ListApiSpecsRequest pageToken + * @property {string|null} [filter] ListApiSpecsRequest filter + */ + + /** + * Constructs a new ListApiSpecsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApiSpecsRequest. + * @implements IListApiSpecsRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListApiSpecsRequest=} [properties] Properties to set + */ + function ListApiSpecsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApiSpecsRequest parent. + * @member {string} parent + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @instance + */ + ListApiSpecsRequest.prototype.parent = ""; + + /** + * ListApiSpecsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @instance + */ + ListApiSpecsRequest.prototype.pageSize = 0; + + /** + * ListApiSpecsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @instance + */ + ListApiSpecsRequest.prototype.pageToken = ""; + + /** + * ListApiSpecsRequest filter. + * @member {string} filter + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @instance + */ + ListApiSpecsRequest.prototype.filter = ""; + + /** + * Creates a new ListApiSpecsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecsRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecsRequest} ListApiSpecsRequest instance + */ + ListApiSpecsRequest.create = function create(properties) { + return new ListApiSpecsRequest(properties); + }; + + /** + * Encodes the specified ListApiSpecsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecsRequest} message ListApiSpecsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiSpecsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListApiSpecsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecsRequest} message ListApiSpecsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiSpecsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiSpecsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecsRequest} ListApiSpecsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiSpecsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListApiSpecsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApiSpecsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecsRequest} ListApiSpecsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiSpecsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiSpecsRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiSpecsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListApiSpecsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecsRequest} ListApiSpecsRequest + */ + ListApiSpecsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApiSpecsRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApiSpecsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListApiSpecsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ListApiSpecsRequest} message ListApiSpecsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiSpecsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListApiSpecsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @instance + * @returns {Object.} JSON object + */ + ListApiSpecsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiSpecsRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiSpecsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListApiSpecsRequest"; + }; + + return ListApiSpecsRequest; + })(); + + v1.ListApiSpecsResponse = (function() { + + /** + * Properties of a ListApiSpecsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApiSpecsResponse + * @property {Array.|null} [apiSpecs] ListApiSpecsResponse apiSpecs + * @property {string|null} [nextPageToken] ListApiSpecsResponse nextPageToken + */ + + /** + * Constructs a new ListApiSpecsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApiSpecsResponse. + * @implements IListApiSpecsResponse + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListApiSpecsResponse=} [properties] Properties to set + */ + function ListApiSpecsResponse(properties) { + this.apiSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApiSpecsResponse apiSpecs. + * @member {Array.} apiSpecs + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @instance + */ + ListApiSpecsResponse.prototype.apiSpecs = $util.emptyArray; + + /** + * ListApiSpecsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @instance + */ + ListApiSpecsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListApiSpecsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecsResponse=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecsResponse} ListApiSpecsResponse instance + */ + ListApiSpecsResponse.create = function create(properties) { + return new ListApiSpecsResponse(properties); + }; + + /** + * Encodes the specified ListApiSpecsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecsResponse} message ListApiSpecsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiSpecsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiSpecs != null && message.apiSpecs.length) + for (var i = 0; i < message.apiSpecs.length; ++i) + $root.google.cloud.apigeeregistry.v1.ApiSpec.encode(message.apiSpecs[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 ListApiSpecsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecsResponse} message ListApiSpecsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiSpecsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiSpecsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecsResponse} ListApiSpecsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiSpecsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListApiSpecsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.apiSpecs && message.apiSpecs.length)) + message.apiSpecs = []; + message.apiSpecs.push($root.google.cloud.apigeeregistry.v1.ApiSpec.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApiSpecsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecsResponse} ListApiSpecsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiSpecsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiSpecsResponse message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiSpecsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiSpecs != null && message.hasOwnProperty("apiSpecs")) { + if (!Array.isArray(message.apiSpecs)) + return "apiSpecs: array expected"; + for (var i = 0; i < message.apiSpecs.length; ++i) { + var error = $root.google.cloud.apigeeregistry.v1.ApiSpec.verify(message.apiSpecs[i]); + if (error) + return "apiSpecs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListApiSpecsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecsResponse} ListApiSpecsResponse + */ + ListApiSpecsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApiSpecsResponse) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApiSpecsResponse(); + if (object.apiSpecs) { + if (!Array.isArray(object.apiSpecs)) + throw TypeError(".google.cloud.apigeeregistry.v1.ListApiSpecsResponse.apiSpecs: array expected"); + message.apiSpecs = []; + for (var i = 0; i < object.apiSpecs.length; ++i) { + if (typeof object.apiSpecs[i] !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ListApiSpecsResponse.apiSpecs: object expected"); + message.apiSpecs[i] = $root.google.cloud.apigeeregistry.v1.ApiSpec.fromObject(object.apiSpecs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListApiSpecsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.ListApiSpecsResponse} message ListApiSpecsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiSpecsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.apiSpecs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.apiSpecs && message.apiSpecs.length) { + object.apiSpecs = []; + for (var j = 0; j < message.apiSpecs.length; ++j) + object.apiSpecs[j] = $root.google.cloud.apigeeregistry.v1.ApiSpec.toObject(message.apiSpecs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListApiSpecsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @instance + * @returns {Object.} JSON object + */ + ListApiSpecsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiSpecsResponse + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiSpecsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListApiSpecsResponse"; + }; + + return ListApiSpecsResponse; + })(); + + v1.GetApiSpecRequest = (function() { + + /** + * Properties of a GetApiSpecRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IGetApiSpecRequest + * @property {string|null} [name] GetApiSpecRequest name + */ + + /** + * Constructs a new GetApiSpecRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a GetApiSpecRequest. + * @implements IGetApiSpecRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecRequest=} [properties] Properties to set + */ + function GetApiSpecRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetApiSpecRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecRequest + * @instance + */ + GetApiSpecRequest.prototype.name = ""; + + /** + * Creates a new GetApiSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.GetApiSpecRequest} GetApiSpecRequest instance + */ + GetApiSpecRequest.create = function create(properties) { + return new GetApiSpecRequest(properties); + }; + + /** + * Encodes the specified GetApiSpecRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecRequest} message GetApiSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiSpecRequest.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 GetApiSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecRequest} message GetApiSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetApiSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.GetApiSpecRequest} GetApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiSpecRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.GetApiSpecRequest(); + 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 GetApiSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.GetApiSpecRequest} GetApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetApiSpecRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetApiSpecRequest.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 GetApiSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.GetApiSpecRequest} GetApiSpecRequest + */ + GetApiSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.GetApiSpecRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.GetApiSpecRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetApiSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.GetApiSpecRequest} message GetApiSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetApiSpecRequest.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 GetApiSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecRequest + * @instance + * @returns {Object.} JSON object + */ + GetApiSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetApiSpecRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetApiSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.GetApiSpecRequest"; + }; + + return GetApiSpecRequest; + })(); + + v1.GetApiSpecContentsRequest = (function() { + + /** + * Properties of a GetApiSpecContentsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IGetApiSpecContentsRequest + * @property {string|null} [name] GetApiSpecContentsRequest name + */ + + /** + * Constructs a new GetApiSpecContentsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a GetApiSpecContentsRequest. + * @implements IGetApiSpecContentsRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest=} [properties] Properties to set + */ + function GetApiSpecContentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetApiSpecContentsRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest + * @instance + */ + GetApiSpecContentsRequest.prototype.name = ""; + + /** + * Creates a new GetApiSpecContentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest} GetApiSpecContentsRequest instance + */ + GetApiSpecContentsRequest.create = function create(properties) { + return new GetApiSpecContentsRequest(properties); + }; + + /** + * Encodes the specified GetApiSpecContentsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest} message GetApiSpecContentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiSpecContentsRequest.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 GetApiSpecContentsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest} message GetApiSpecContentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiSpecContentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetApiSpecContentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest} GetApiSpecContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiSpecContentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest(); + 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 GetApiSpecContentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest} GetApiSpecContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiSpecContentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetApiSpecContentsRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetApiSpecContentsRequest.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 GetApiSpecContentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest} GetApiSpecContentsRequest + */ + GetApiSpecContentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetApiSpecContentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest} message GetApiSpecContentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetApiSpecContentsRequest.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 GetApiSpecContentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest + * @instance + * @returns {Object.} JSON object + */ + GetApiSpecContentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetApiSpecContentsRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetApiSpecContentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest"; + }; + + return GetApiSpecContentsRequest; + })(); + + v1.CreateApiSpecRequest = (function() { + + /** + * Properties of a CreateApiSpecRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface ICreateApiSpecRequest + * @property {string|null} [parent] CreateApiSpecRequest parent + * @property {google.cloud.apigeeregistry.v1.IApiSpec|null} [apiSpec] CreateApiSpecRequest apiSpec + * @property {string|null} [apiSpecId] CreateApiSpecRequest apiSpecId + */ + + /** + * Constructs a new CreateApiSpecRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a CreateApiSpecRequest. + * @implements ICreateApiSpecRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.ICreateApiSpecRequest=} [properties] Properties to set + */ + function CreateApiSpecRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateApiSpecRequest parent. + * @member {string} parent + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @instance + */ + CreateApiSpecRequest.prototype.parent = ""; + + /** + * CreateApiSpecRequest apiSpec. + * @member {google.cloud.apigeeregistry.v1.IApiSpec|null|undefined} apiSpec + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @instance + */ + CreateApiSpecRequest.prototype.apiSpec = null; + + /** + * CreateApiSpecRequest apiSpecId. + * @member {string} apiSpecId + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @instance + */ + CreateApiSpecRequest.prototype.apiSpecId = ""; + + /** + * Creates a new CreateApiSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateApiSpecRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.CreateApiSpecRequest} CreateApiSpecRequest instance + */ + CreateApiSpecRequest.create = function create(properties) { + return new CreateApiSpecRequest(properties); + }; + + /** + * Encodes the specified CreateApiSpecRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateApiSpecRequest} message CreateApiSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApiSpecRequest.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.apiSpec != null && Object.hasOwnProperty.call(message, "apiSpec")) + $root.google.cloud.apigeeregistry.v1.ApiSpec.encode(message.apiSpec, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.apiSpecId != null && Object.hasOwnProperty.call(message, "apiSpecId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.apiSpecId); + return writer; + }; + + /** + * Encodes the specified CreateApiSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateApiSpecRequest} message CreateApiSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApiSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateApiSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.CreateApiSpecRequest} CreateApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApiSpecRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.CreateApiSpecRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.apiSpec = $root.google.cloud.apigeeregistry.v1.ApiSpec.decode(reader, reader.uint32()); + break; + } + case 3: { + message.apiSpecId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateApiSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.CreateApiSpecRequest} CreateApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApiSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateApiSpecRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateApiSpecRequest.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.apiSpec != null && message.hasOwnProperty("apiSpec")) { + var error = $root.google.cloud.apigeeregistry.v1.ApiSpec.verify(message.apiSpec); + if (error) + return "apiSpec." + error; + } + if (message.apiSpecId != null && message.hasOwnProperty("apiSpecId")) + if (!$util.isString(message.apiSpecId)) + return "apiSpecId: string expected"; + return null; + }; + + /** + * Creates a CreateApiSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.CreateApiSpecRequest} CreateApiSpecRequest + */ + CreateApiSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.CreateApiSpecRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.CreateApiSpecRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.apiSpec != null) { + if (typeof object.apiSpec !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.CreateApiSpecRequest.apiSpec: object expected"); + message.apiSpec = $root.google.cloud.apigeeregistry.v1.ApiSpec.fromObject(object.apiSpec); + } + if (object.apiSpecId != null) + message.apiSpecId = String(object.apiSpecId); + return message; + }; + + /** + * Creates a plain object from a CreateApiSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.CreateApiSpecRequest} message CreateApiSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateApiSpecRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.apiSpec = null; + object.apiSpecId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.apiSpec != null && message.hasOwnProperty("apiSpec")) + object.apiSpec = $root.google.cloud.apigeeregistry.v1.ApiSpec.toObject(message.apiSpec, options); + if (message.apiSpecId != null && message.hasOwnProperty("apiSpecId")) + object.apiSpecId = message.apiSpecId; + return object; + }; + + /** + * Converts this CreateApiSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @instance + * @returns {Object.} JSON object + */ + CreateApiSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateApiSpecRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.CreateApiSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateApiSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.CreateApiSpecRequest"; + }; + + return CreateApiSpecRequest; + })(); + + v1.UpdateApiSpecRequest = (function() { + + /** + * Properties of an UpdateApiSpecRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IUpdateApiSpecRequest + * @property {google.cloud.apigeeregistry.v1.IApiSpec|null} [apiSpec] UpdateApiSpecRequest apiSpec + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateApiSpecRequest updateMask + * @property {boolean|null} [allowMissing] UpdateApiSpecRequest allowMissing + */ + + /** + * Constructs a new UpdateApiSpecRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents an UpdateApiSpecRequest. + * @implements IUpdateApiSpecRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest=} [properties] Properties to set + */ + function UpdateApiSpecRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateApiSpecRequest apiSpec. + * @member {google.cloud.apigeeregistry.v1.IApiSpec|null|undefined} apiSpec + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @instance + */ + UpdateApiSpecRequest.prototype.apiSpec = null; + + /** + * UpdateApiSpecRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @instance + */ + UpdateApiSpecRequest.prototype.updateMask = null; + + /** + * UpdateApiSpecRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @instance + */ + UpdateApiSpecRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateApiSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.UpdateApiSpecRequest} UpdateApiSpecRequest instance + */ + UpdateApiSpecRequest.create = function create(properties) { + return new UpdateApiSpecRequest(properties); + }; + + /** + * Encodes the specified UpdateApiSpecRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest} message UpdateApiSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApiSpecRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiSpec != null && Object.hasOwnProperty.call(message, "apiSpec")) + $root.google.cloud.apigeeregistry.v1.ApiSpec.encode(message.apiSpec, 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(); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateApiSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest} message UpdateApiSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApiSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateApiSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.UpdateApiSpecRequest} UpdateApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApiSpecRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.apiSpec = $root.google.cloud.apigeeregistry.v1.ApiSpec.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateApiSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.UpdateApiSpecRequest} UpdateApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApiSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateApiSpecRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateApiSpecRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiSpec != null && message.hasOwnProperty("apiSpec")) { + var error = $root.google.cloud.apigeeregistry.v1.ApiSpec.verify(message.apiSpec); + if (error) + return "apiSpec." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateApiSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.UpdateApiSpecRequest} UpdateApiSpecRequest + */ + UpdateApiSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest(); + if (object.apiSpec != null) { + if (typeof object.apiSpec !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.UpdateApiSpecRequest.apiSpec: object expected"); + message.apiSpec = $root.google.cloud.apigeeregistry.v1.ApiSpec.fromObject(object.apiSpec); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.UpdateApiSpecRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateApiSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.UpdateApiSpecRequest} message UpdateApiSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateApiSpecRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.apiSpec = null; + object.updateMask = null; + object.allowMissing = false; + } + if (message.apiSpec != null && message.hasOwnProperty("apiSpec")) + object.apiSpec = $root.google.cloud.apigeeregistry.v1.ApiSpec.toObject(message.apiSpec, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateApiSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateApiSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateApiSpecRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.UpdateApiSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateApiSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.UpdateApiSpecRequest"; + }; + + return UpdateApiSpecRequest; + })(); + + v1.DeleteApiSpecRequest = (function() { + + /** + * Properties of a DeleteApiSpecRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IDeleteApiSpecRequest + * @property {string|null} [name] DeleteApiSpecRequest name + * @property {boolean|null} [force] DeleteApiSpecRequest force + */ + + /** + * Constructs a new DeleteApiSpecRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a DeleteApiSpecRequest. + * @implements IDeleteApiSpecRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest=} [properties] Properties to set + */ + function DeleteApiSpecRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteApiSpecRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @instance + */ + DeleteApiSpecRequest.prototype.name = ""; + + /** + * DeleteApiSpecRequest force. + * @member {boolean} force + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @instance + */ + DeleteApiSpecRequest.prototype.force = false; + + /** + * Creates a new DeleteApiSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.DeleteApiSpecRequest} DeleteApiSpecRequest instance + */ + DeleteApiSpecRequest.create = function create(properties) { + return new DeleteApiSpecRequest(properties); + }; + + /** + * Encodes the specified DeleteApiSpecRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest} message DeleteApiSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiSpecRequest.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 DeleteApiSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest} message DeleteApiSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteApiSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.DeleteApiSpecRequest} DeleteApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiSpecRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest(); + 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 DeleteApiSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.DeleteApiSpecRequest} DeleteApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteApiSpecRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteApiSpecRequest.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 DeleteApiSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.DeleteApiSpecRequest} DeleteApiSpecRequest + */ + DeleteApiSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest(); + 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 DeleteApiSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.DeleteApiSpecRequest} message DeleteApiSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteApiSpecRequest.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 DeleteApiSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteApiSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteApiSpecRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteApiSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.DeleteApiSpecRequest"; + }; + + return DeleteApiSpecRequest; + })(); + + v1.TagApiSpecRevisionRequest = (function() { + + /** + * Properties of a TagApiSpecRevisionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface ITagApiSpecRevisionRequest + * @property {string|null} [name] TagApiSpecRevisionRequest name + * @property {string|null} [tag] TagApiSpecRevisionRequest tag + */ + + /** + * Constructs a new TagApiSpecRevisionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a TagApiSpecRevisionRequest. + * @implements ITagApiSpecRevisionRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest=} [properties] Properties to set + */ + function TagApiSpecRevisionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TagApiSpecRevisionRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @instance + */ + TagApiSpecRevisionRequest.prototype.name = ""; + + /** + * TagApiSpecRevisionRequest tag. + * @member {string} tag + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @instance + */ + TagApiSpecRevisionRequest.prototype.tag = ""; + + /** + * Creates a new TagApiSpecRevisionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest} TagApiSpecRevisionRequest instance + */ + TagApiSpecRevisionRequest.create = function create(properties) { + return new TagApiSpecRevisionRequest(properties); + }; + + /** + * Encodes the specified TagApiSpecRevisionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest} message TagApiSpecRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TagApiSpecRevisionRequest.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.tag != null && Object.hasOwnProperty.call(message, "tag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tag); + return writer; + }; + + /** + * Encodes the specified TagApiSpecRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest} message TagApiSpecRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TagApiSpecRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TagApiSpecRevisionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest} TagApiSpecRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TagApiSpecRevisionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.tag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TagApiSpecRevisionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest} TagApiSpecRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TagApiSpecRevisionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TagApiSpecRevisionRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TagApiSpecRevisionRequest.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.tag != null && message.hasOwnProperty("tag")) + if (!$util.isString(message.tag)) + return "tag: string expected"; + return null; + }; + + /** + * Creates a TagApiSpecRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest} TagApiSpecRevisionRequest + */ + TagApiSpecRevisionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.tag != null) + message.tag = String(object.tag); + return message; + }; + + /** + * Creates a plain object from a TagApiSpecRevisionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest} message TagApiSpecRevisionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TagApiSpecRevisionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.tag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.tag != null && message.hasOwnProperty("tag")) + object.tag = message.tag; + return object; + }; + + /** + * Converts this TagApiSpecRevisionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @instance + * @returns {Object.} JSON object + */ + TagApiSpecRevisionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TagApiSpecRevisionRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TagApiSpecRevisionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest"; + }; + + return TagApiSpecRevisionRequest; + })(); + + v1.ListApiSpecRevisionsRequest = (function() { + + /** + * Properties of a ListApiSpecRevisionsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApiSpecRevisionsRequest + * @property {string|null} [name] ListApiSpecRevisionsRequest name + * @property {number|null} [pageSize] ListApiSpecRevisionsRequest pageSize + * @property {string|null} [pageToken] ListApiSpecRevisionsRequest pageToken + */ + + /** + * Constructs a new ListApiSpecRevisionsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApiSpecRevisionsRequest. + * @implements IListApiSpecRevisionsRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest=} [properties] Properties to set + */ + function ListApiSpecRevisionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApiSpecRevisionsRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @instance + */ + ListApiSpecRevisionsRequest.prototype.name = ""; + + /** + * ListApiSpecRevisionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @instance + */ + ListApiSpecRevisionsRequest.prototype.pageSize = 0; + + /** + * ListApiSpecRevisionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @instance + */ + ListApiSpecRevisionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListApiSpecRevisionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest} ListApiSpecRevisionsRequest instance + */ + ListApiSpecRevisionsRequest.create = function create(properties) { + return new ListApiSpecRevisionsRequest(properties); + }; + + /** + * Encodes the specified ListApiSpecRevisionsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest} message ListApiSpecRevisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiSpecRevisionsRequest.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.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 ListApiSpecRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest} message ListApiSpecRevisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiSpecRevisionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiSpecRevisionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest} ListApiSpecRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiSpecRevisionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = 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 ListApiSpecRevisionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest} ListApiSpecRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiSpecRevisionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiSpecRevisionsRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiSpecRevisionsRequest.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.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 ListApiSpecRevisionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest} ListApiSpecRevisionsRequest + */ + ListApiSpecRevisionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest(); + if (object.name != null) + message.name = String(object.name); + 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 ListApiSpecRevisionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest} message ListApiSpecRevisionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiSpecRevisionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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 ListApiSpecRevisionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListApiSpecRevisionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiSpecRevisionsRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiSpecRevisionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest"; + }; + + return ListApiSpecRevisionsRequest; + })(); + + v1.ListApiSpecRevisionsResponse = (function() { + + /** + * Properties of a ListApiSpecRevisionsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApiSpecRevisionsResponse + * @property {Array.|null} [apiSpecs] ListApiSpecRevisionsResponse apiSpecs + * @property {string|null} [nextPageToken] ListApiSpecRevisionsResponse nextPageToken + */ + + /** + * Constructs a new ListApiSpecRevisionsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApiSpecRevisionsResponse. + * @implements IListApiSpecRevisionsResponse + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse=} [properties] Properties to set + */ + function ListApiSpecRevisionsResponse(properties) { + this.apiSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApiSpecRevisionsResponse apiSpecs. + * @member {Array.} apiSpecs + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @instance + */ + ListApiSpecRevisionsResponse.prototype.apiSpecs = $util.emptyArray; + + /** + * ListApiSpecRevisionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @instance + */ + ListApiSpecRevisionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListApiSpecRevisionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse} ListApiSpecRevisionsResponse instance + */ + ListApiSpecRevisionsResponse.create = function create(properties) { + return new ListApiSpecRevisionsResponse(properties); + }; + + /** + * Encodes the specified ListApiSpecRevisionsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse} message ListApiSpecRevisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiSpecRevisionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiSpecs != null && message.apiSpecs.length) + for (var i = 0; i < message.apiSpecs.length; ++i) + $root.google.cloud.apigeeregistry.v1.ApiSpec.encode(message.apiSpecs[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 ListApiSpecRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse} message ListApiSpecRevisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiSpecRevisionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiSpecRevisionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse} ListApiSpecRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiSpecRevisionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.apiSpecs && message.apiSpecs.length)) + message.apiSpecs = []; + message.apiSpecs.push($root.google.cloud.apigeeregistry.v1.ApiSpec.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApiSpecRevisionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse} ListApiSpecRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiSpecRevisionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiSpecRevisionsResponse message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiSpecRevisionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiSpecs != null && message.hasOwnProperty("apiSpecs")) { + if (!Array.isArray(message.apiSpecs)) + return "apiSpecs: array expected"; + for (var i = 0; i < message.apiSpecs.length; ++i) { + var error = $root.google.cloud.apigeeregistry.v1.ApiSpec.verify(message.apiSpecs[i]); + if (error) + return "apiSpecs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListApiSpecRevisionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse} ListApiSpecRevisionsResponse + */ + ListApiSpecRevisionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse(); + if (object.apiSpecs) { + if (!Array.isArray(object.apiSpecs)) + throw TypeError(".google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse.apiSpecs: array expected"); + message.apiSpecs = []; + for (var i = 0; i < object.apiSpecs.length; ++i) { + if (typeof object.apiSpecs[i] !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse.apiSpecs: object expected"); + message.apiSpecs[i] = $root.google.cloud.apigeeregistry.v1.ApiSpec.fromObject(object.apiSpecs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListApiSpecRevisionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse} message ListApiSpecRevisionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiSpecRevisionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.apiSpecs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.apiSpecs && message.apiSpecs.length) { + object.apiSpecs = []; + for (var j = 0; j < message.apiSpecs.length; ++j) + object.apiSpecs[j] = $root.google.cloud.apigeeregistry.v1.ApiSpec.toObject(message.apiSpecs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListApiSpecRevisionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListApiSpecRevisionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiSpecRevisionsResponse + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiSpecRevisionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse"; + }; + + return ListApiSpecRevisionsResponse; + })(); + + v1.RollbackApiSpecRequest = (function() { + + /** + * Properties of a RollbackApiSpecRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IRollbackApiSpecRequest + * @property {string|null} [name] RollbackApiSpecRequest name + * @property {string|null} [revisionId] RollbackApiSpecRequest revisionId + */ + + /** + * Constructs a new RollbackApiSpecRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a RollbackApiSpecRequest. + * @implements IRollbackApiSpecRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest=} [properties] Properties to set + */ + function RollbackApiSpecRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RollbackApiSpecRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @instance + */ + RollbackApiSpecRequest.prototype.name = ""; + + /** + * RollbackApiSpecRequest revisionId. + * @member {string} revisionId + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @instance + */ + RollbackApiSpecRequest.prototype.revisionId = ""; + + /** + * Creates a new RollbackApiSpecRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.RollbackApiSpecRequest} RollbackApiSpecRequest instance + */ + RollbackApiSpecRequest.create = function create(properties) { + return new RollbackApiSpecRequest(properties); + }; + + /** + * Encodes the specified RollbackApiSpecRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.RollbackApiSpecRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest} message RollbackApiSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackApiSpecRequest.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.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.revisionId); + return writer; + }; + + /** + * Encodes the specified RollbackApiSpecRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.RollbackApiSpecRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest} message RollbackApiSpecRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackApiSpecRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RollbackApiSpecRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.RollbackApiSpecRequest} RollbackApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackApiSpecRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.revisionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RollbackApiSpecRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.RollbackApiSpecRequest} RollbackApiSpecRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackApiSpecRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RollbackApiSpecRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RollbackApiSpecRequest.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.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + return null; + }; + + /** + * Creates a RollbackApiSpecRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.RollbackApiSpecRequest} RollbackApiSpecRequest + */ + RollbackApiSpecRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + return message; + }; + + /** + * Creates a plain object from a RollbackApiSpecRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @static + * @param {google.cloud.apigeeregistry.v1.RollbackApiSpecRequest} message RollbackApiSpecRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RollbackApiSpecRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.revisionId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + return object; + }; + + /** + * Converts this RollbackApiSpecRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @instance + * @returns {Object.} JSON object + */ + RollbackApiSpecRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RollbackApiSpecRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.RollbackApiSpecRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RollbackApiSpecRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.RollbackApiSpecRequest"; + }; + + return RollbackApiSpecRequest; + })(); + + v1.DeleteApiSpecRevisionRequest = (function() { + + /** + * Properties of a DeleteApiSpecRevisionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IDeleteApiSpecRevisionRequest + * @property {string|null} [name] DeleteApiSpecRevisionRequest name + */ + + /** + * Constructs a new DeleteApiSpecRevisionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a DeleteApiSpecRevisionRequest. + * @implements IDeleteApiSpecRevisionRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest=} [properties] Properties to set + */ + function DeleteApiSpecRevisionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteApiSpecRevisionRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest + * @instance + */ + DeleteApiSpecRevisionRequest.prototype.name = ""; + + /** + * Creates a new DeleteApiSpecRevisionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest} DeleteApiSpecRevisionRequest instance + */ + DeleteApiSpecRevisionRequest.create = function create(properties) { + return new DeleteApiSpecRevisionRequest(properties); + }; + + /** + * Encodes the specified DeleteApiSpecRevisionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest} message DeleteApiSpecRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiSpecRevisionRequest.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 DeleteApiSpecRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest} message DeleteApiSpecRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiSpecRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteApiSpecRevisionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest} DeleteApiSpecRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiSpecRevisionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest(); + 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 DeleteApiSpecRevisionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest} DeleteApiSpecRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiSpecRevisionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteApiSpecRevisionRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteApiSpecRevisionRequest.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 DeleteApiSpecRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest} DeleteApiSpecRevisionRequest + */ + DeleteApiSpecRevisionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteApiSpecRevisionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest} message DeleteApiSpecRevisionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteApiSpecRevisionRequest.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 DeleteApiSpecRevisionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteApiSpecRevisionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteApiSpecRevisionRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteApiSpecRevisionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest"; + }; + + return DeleteApiSpecRevisionRequest; + })(); + + v1.ListApiDeploymentsRequest = (function() { + + /** + * Properties of a ListApiDeploymentsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApiDeploymentsRequest + * @property {string|null} [parent] ListApiDeploymentsRequest parent + * @property {number|null} [pageSize] ListApiDeploymentsRequest pageSize + * @property {string|null} [pageToken] ListApiDeploymentsRequest pageToken + * @property {string|null} [filter] ListApiDeploymentsRequest filter + */ + + /** + * Constructs a new ListApiDeploymentsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApiDeploymentsRequest. + * @implements IListApiDeploymentsRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest=} [properties] Properties to set + */ + function ListApiDeploymentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApiDeploymentsRequest parent. + * @member {string} parent + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @instance + */ + ListApiDeploymentsRequest.prototype.parent = ""; + + /** + * ListApiDeploymentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @instance + */ + ListApiDeploymentsRequest.prototype.pageSize = 0; + + /** + * ListApiDeploymentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @instance + */ + ListApiDeploymentsRequest.prototype.pageToken = ""; + + /** + * ListApiDeploymentsRequest filter. + * @member {string} filter + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @instance + */ + ListApiDeploymentsRequest.prototype.filter = ""; + + /** + * Creates a new ListApiDeploymentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest} ListApiDeploymentsRequest instance + */ + ListApiDeploymentsRequest.create = function create(properties) { + return new ListApiDeploymentsRequest(properties); + }; + + /** + * Encodes the specified ListApiDeploymentsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest} message ListApiDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiDeploymentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListApiDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest} message ListApiDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiDeploymentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiDeploymentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest} ListApiDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiDeploymentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApiDeploymentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest} ListApiDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiDeploymentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiDeploymentsRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiDeploymentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListApiDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest} ListApiDeploymentsRequest + */ + ListApiDeploymentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListApiDeploymentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest} message ListApiDeploymentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiDeploymentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListApiDeploymentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListApiDeploymentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiDeploymentsRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiDeploymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest"; + }; + + return ListApiDeploymentsRequest; + })(); + + v1.ListApiDeploymentsResponse = (function() { + + /** + * Properties of a ListApiDeploymentsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApiDeploymentsResponse + * @property {Array.|null} [apiDeployments] ListApiDeploymentsResponse apiDeployments + * @property {string|null} [nextPageToken] ListApiDeploymentsResponse nextPageToken + */ + + /** + * Constructs a new ListApiDeploymentsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApiDeploymentsResponse. + * @implements IListApiDeploymentsResponse + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse=} [properties] Properties to set + */ + function ListApiDeploymentsResponse(properties) { + this.apiDeployments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApiDeploymentsResponse apiDeployments. + * @member {Array.} apiDeployments + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @instance + */ + ListApiDeploymentsResponse.prototype.apiDeployments = $util.emptyArray; + + /** + * ListApiDeploymentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @instance + */ + ListApiDeploymentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListApiDeploymentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse} ListApiDeploymentsResponse instance + */ + ListApiDeploymentsResponse.create = function create(properties) { + return new ListApiDeploymentsResponse(properties); + }; + + /** + * Encodes the specified ListApiDeploymentsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse} message ListApiDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiDeploymentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiDeployments != null && message.apiDeployments.length) + for (var i = 0; i < message.apiDeployments.length; ++i) + $root.google.cloud.apigeeregistry.v1.ApiDeployment.encode(message.apiDeployments[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 ListApiDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse} message ListApiDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiDeploymentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiDeploymentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse} ListApiDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiDeploymentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.apiDeployments && message.apiDeployments.length)) + message.apiDeployments = []; + message.apiDeployments.push($root.google.cloud.apigeeregistry.v1.ApiDeployment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApiDeploymentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse} ListApiDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiDeploymentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiDeploymentsResponse message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiDeploymentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiDeployments != null && message.hasOwnProperty("apiDeployments")) { + if (!Array.isArray(message.apiDeployments)) + return "apiDeployments: array expected"; + for (var i = 0; i < message.apiDeployments.length; ++i) { + var error = $root.google.cloud.apigeeregistry.v1.ApiDeployment.verify(message.apiDeployments[i]); + if (error) + return "apiDeployments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListApiDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse} ListApiDeploymentsResponse + */ + ListApiDeploymentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse(); + if (object.apiDeployments) { + if (!Array.isArray(object.apiDeployments)) + throw TypeError(".google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse.apiDeployments: array expected"); + message.apiDeployments = []; + for (var i = 0; i < object.apiDeployments.length; ++i) { + if (typeof object.apiDeployments[i] !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse.apiDeployments: object expected"); + message.apiDeployments[i] = $root.google.cloud.apigeeregistry.v1.ApiDeployment.fromObject(object.apiDeployments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListApiDeploymentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse} message ListApiDeploymentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiDeploymentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.apiDeployments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.apiDeployments && message.apiDeployments.length) { + object.apiDeployments = []; + for (var j = 0; j < message.apiDeployments.length; ++j) + object.apiDeployments[j] = $root.google.cloud.apigeeregistry.v1.ApiDeployment.toObject(message.apiDeployments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListApiDeploymentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListApiDeploymentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiDeploymentsResponse + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiDeploymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse"; + }; + + return ListApiDeploymentsResponse; + })(); + + v1.GetApiDeploymentRequest = (function() { + + /** + * Properties of a GetApiDeploymentRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IGetApiDeploymentRequest + * @property {string|null} [name] GetApiDeploymentRequest name + */ + + /** + * Constructs a new GetApiDeploymentRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a GetApiDeploymentRequest. + * @implements IGetApiDeploymentRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest=} [properties] Properties to set + */ + function GetApiDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetApiDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.GetApiDeploymentRequest + * @instance + */ + GetApiDeploymentRequest.prototype.name = ""; + + /** + * Creates a new GetApiDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.GetApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.GetApiDeploymentRequest} GetApiDeploymentRequest instance + */ + GetApiDeploymentRequest.create = function create(properties) { + return new GetApiDeploymentRequest(properties); + }; + + /** + * Encodes the specified GetApiDeploymentRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.GetApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest} message GetApiDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiDeploymentRequest.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 GetApiDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetApiDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest} message GetApiDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetApiDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetApiDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.GetApiDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.GetApiDeploymentRequest} GetApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest(); + 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 GetApiDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetApiDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.GetApiDeploymentRequest} GetApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetApiDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetApiDeploymentRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.GetApiDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetApiDeploymentRequest.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 GetApiDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.GetApiDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.GetApiDeploymentRequest} GetApiDeploymentRequest + */ + GetApiDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetApiDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.GetApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.GetApiDeploymentRequest} message GetApiDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetApiDeploymentRequest.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 GetApiDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.GetApiDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + GetApiDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetApiDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.GetApiDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetApiDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.GetApiDeploymentRequest"; + }; + + return GetApiDeploymentRequest; + })(); + + v1.CreateApiDeploymentRequest = (function() { + + /** + * Properties of a CreateApiDeploymentRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface ICreateApiDeploymentRequest + * @property {string|null} [parent] CreateApiDeploymentRequest parent + * @property {google.cloud.apigeeregistry.v1.IApiDeployment|null} [apiDeployment] CreateApiDeploymentRequest apiDeployment + * @property {string|null} [apiDeploymentId] CreateApiDeploymentRequest apiDeploymentId + */ + + /** + * Constructs a new CreateApiDeploymentRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a CreateApiDeploymentRequest. + * @implements ICreateApiDeploymentRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest=} [properties] Properties to set + */ + function CreateApiDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateApiDeploymentRequest parent. + * @member {string} parent + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @instance + */ + CreateApiDeploymentRequest.prototype.parent = ""; + + /** + * CreateApiDeploymentRequest apiDeployment. + * @member {google.cloud.apigeeregistry.v1.IApiDeployment|null|undefined} apiDeployment + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @instance + */ + CreateApiDeploymentRequest.prototype.apiDeployment = null; + + /** + * CreateApiDeploymentRequest apiDeploymentId. + * @member {string} apiDeploymentId + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @instance + */ + CreateApiDeploymentRequest.prototype.apiDeploymentId = ""; + + /** + * Creates a new CreateApiDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest} CreateApiDeploymentRequest instance + */ + CreateApiDeploymentRequest.create = function create(properties) { + return new CreateApiDeploymentRequest(properties); + }; + + /** + * Encodes the specified CreateApiDeploymentRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest} message CreateApiDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApiDeploymentRequest.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.apiDeployment != null && Object.hasOwnProperty.call(message, "apiDeployment")) + $root.google.cloud.apigeeregistry.v1.ApiDeployment.encode(message.apiDeployment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.apiDeploymentId != null && Object.hasOwnProperty.call(message, "apiDeploymentId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.apiDeploymentId); + return writer; + }; + + /** + * Encodes the specified CreateApiDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest} message CreateApiDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateApiDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateApiDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest} CreateApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApiDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.apiDeployment = $root.google.cloud.apigeeregistry.v1.ApiDeployment.decode(reader, reader.uint32()); + break; + } + case 3: { + message.apiDeploymentId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateApiDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest} CreateApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateApiDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateApiDeploymentRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateApiDeploymentRequest.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.apiDeployment != null && message.hasOwnProperty("apiDeployment")) { + var error = $root.google.cloud.apigeeregistry.v1.ApiDeployment.verify(message.apiDeployment); + if (error) + return "apiDeployment." + error; + } + if (message.apiDeploymentId != null && message.hasOwnProperty("apiDeploymentId")) + if (!$util.isString(message.apiDeploymentId)) + return "apiDeploymentId: string expected"; + return null; + }; + + /** + * Creates a CreateApiDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest} CreateApiDeploymentRequest + */ + CreateApiDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.apiDeployment != null) { + if (typeof object.apiDeployment !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest.apiDeployment: object expected"); + message.apiDeployment = $root.google.cloud.apigeeregistry.v1.ApiDeployment.fromObject(object.apiDeployment); + } + if (object.apiDeploymentId != null) + message.apiDeploymentId = String(object.apiDeploymentId); + return message; + }; + + /** + * Creates a plain object from a CreateApiDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest} message CreateApiDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateApiDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.apiDeployment = null; + object.apiDeploymentId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.apiDeployment != null && message.hasOwnProperty("apiDeployment")) + object.apiDeployment = $root.google.cloud.apigeeregistry.v1.ApiDeployment.toObject(message.apiDeployment, options); + if (message.apiDeploymentId != null && message.hasOwnProperty("apiDeploymentId")) + object.apiDeploymentId = message.apiDeploymentId; + return object; + }; + + /** + * Converts this CreateApiDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateApiDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateApiDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateApiDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest"; + }; + + return CreateApiDeploymentRequest; + })(); + + v1.UpdateApiDeploymentRequest = (function() { + + /** + * Properties of an UpdateApiDeploymentRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IUpdateApiDeploymentRequest + * @property {google.cloud.apigeeregistry.v1.IApiDeployment|null} [apiDeployment] UpdateApiDeploymentRequest apiDeployment + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateApiDeploymentRequest updateMask + * @property {boolean|null} [allowMissing] UpdateApiDeploymentRequest allowMissing + */ + + /** + * Constructs a new UpdateApiDeploymentRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents an UpdateApiDeploymentRequest. + * @implements IUpdateApiDeploymentRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest=} [properties] Properties to set + */ + function UpdateApiDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateApiDeploymentRequest apiDeployment. + * @member {google.cloud.apigeeregistry.v1.IApiDeployment|null|undefined} apiDeployment + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @instance + */ + UpdateApiDeploymentRequest.prototype.apiDeployment = null; + + /** + * UpdateApiDeploymentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @instance + */ + UpdateApiDeploymentRequest.prototype.updateMask = null; + + /** + * UpdateApiDeploymentRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @instance + */ + UpdateApiDeploymentRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateApiDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest} UpdateApiDeploymentRequest instance + */ + UpdateApiDeploymentRequest.create = function create(properties) { + return new UpdateApiDeploymentRequest(properties); + }; + + /** + * Encodes the specified UpdateApiDeploymentRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest} message UpdateApiDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApiDeploymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiDeployment != null && Object.hasOwnProperty.call(message, "apiDeployment")) + $root.google.cloud.apigeeregistry.v1.ApiDeployment.encode(message.apiDeployment, 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(); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateApiDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest} message UpdateApiDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateApiDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateApiDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest} UpdateApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApiDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.apiDeployment = $root.google.cloud.apigeeregistry.v1.ApiDeployment.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateApiDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest} UpdateApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateApiDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateApiDeploymentRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateApiDeploymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiDeployment != null && message.hasOwnProperty("apiDeployment")) { + var error = $root.google.cloud.apigeeregistry.v1.ApiDeployment.verify(message.apiDeployment); + if (error) + return "apiDeployment." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateApiDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest} UpdateApiDeploymentRequest + */ + UpdateApiDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest(); + if (object.apiDeployment != null) { + if (typeof object.apiDeployment !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest.apiDeployment: object expected"); + message.apiDeployment = $root.google.cloud.apigeeregistry.v1.ApiDeployment.fromObject(object.apiDeployment); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateApiDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest} message UpdateApiDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateApiDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.apiDeployment = null; + object.updateMask = null; + object.allowMissing = false; + } + if (message.apiDeployment != null && message.hasOwnProperty("apiDeployment")) + object.apiDeployment = $root.google.cloud.apigeeregistry.v1.ApiDeployment.toObject(message.apiDeployment, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateApiDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateApiDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateApiDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateApiDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest"; + }; + + return UpdateApiDeploymentRequest; + })(); + + v1.DeleteApiDeploymentRequest = (function() { + + /** + * Properties of a DeleteApiDeploymentRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IDeleteApiDeploymentRequest + * @property {string|null} [name] DeleteApiDeploymentRequest name + * @property {boolean|null} [force] DeleteApiDeploymentRequest force + */ + + /** + * Constructs a new DeleteApiDeploymentRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a DeleteApiDeploymentRequest. + * @implements IDeleteApiDeploymentRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest=} [properties] Properties to set + */ + function DeleteApiDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteApiDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @instance + */ + DeleteApiDeploymentRequest.prototype.name = ""; + + /** + * DeleteApiDeploymentRequest force. + * @member {boolean} force + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @instance + */ + DeleteApiDeploymentRequest.prototype.force = false; + + /** + * Creates a new DeleteApiDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest} DeleteApiDeploymentRequest instance + */ + DeleteApiDeploymentRequest.create = function create(properties) { + return new DeleteApiDeploymentRequest(properties); + }; + + /** + * Encodes the specified DeleteApiDeploymentRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest} message DeleteApiDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiDeploymentRequest.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 DeleteApiDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest} message DeleteApiDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteApiDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest} DeleteApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest(); + 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 DeleteApiDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest} DeleteApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteApiDeploymentRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteApiDeploymentRequest.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 DeleteApiDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest} DeleteApiDeploymentRequest + */ + DeleteApiDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest(); + 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 DeleteApiDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest} message DeleteApiDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteApiDeploymentRequest.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 DeleteApiDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteApiDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteApiDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteApiDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest"; + }; + + return DeleteApiDeploymentRequest; + })(); + + v1.TagApiDeploymentRevisionRequest = (function() { + + /** + * Properties of a TagApiDeploymentRevisionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface ITagApiDeploymentRevisionRequest + * @property {string|null} [name] TagApiDeploymentRevisionRequest name + * @property {string|null} [tag] TagApiDeploymentRevisionRequest tag + */ + + /** + * Constructs a new TagApiDeploymentRevisionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a TagApiDeploymentRevisionRequest. + * @implements ITagApiDeploymentRevisionRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest=} [properties] Properties to set + */ + function TagApiDeploymentRevisionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TagApiDeploymentRevisionRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @instance + */ + TagApiDeploymentRevisionRequest.prototype.name = ""; + + /** + * TagApiDeploymentRevisionRequest tag. + * @member {string} tag + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @instance + */ + TagApiDeploymentRevisionRequest.prototype.tag = ""; + + /** + * Creates a new TagApiDeploymentRevisionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest} TagApiDeploymentRevisionRequest instance + */ + TagApiDeploymentRevisionRequest.create = function create(properties) { + return new TagApiDeploymentRevisionRequest(properties); + }; + + /** + * Encodes the specified TagApiDeploymentRevisionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest} message TagApiDeploymentRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TagApiDeploymentRevisionRequest.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.tag != null && Object.hasOwnProperty.call(message, "tag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tag); + return writer; + }; + + /** + * Encodes the specified TagApiDeploymentRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest} message TagApiDeploymentRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TagApiDeploymentRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TagApiDeploymentRevisionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest} TagApiDeploymentRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TagApiDeploymentRevisionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.tag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TagApiDeploymentRevisionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest} TagApiDeploymentRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TagApiDeploymentRevisionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TagApiDeploymentRevisionRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TagApiDeploymentRevisionRequest.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.tag != null && message.hasOwnProperty("tag")) + if (!$util.isString(message.tag)) + return "tag: string expected"; + return null; + }; + + /** + * Creates a TagApiDeploymentRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest} TagApiDeploymentRevisionRequest + */ + TagApiDeploymentRevisionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.tag != null) + message.tag = String(object.tag); + return message; + }; + + /** + * Creates a plain object from a TagApiDeploymentRevisionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest} message TagApiDeploymentRevisionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TagApiDeploymentRevisionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.tag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.tag != null && message.hasOwnProperty("tag")) + object.tag = message.tag; + return object; + }; + + /** + * Converts this TagApiDeploymentRevisionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @instance + * @returns {Object.} JSON object + */ + TagApiDeploymentRevisionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TagApiDeploymentRevisionRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TagApiDeploymentRevisionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest"; + }; + + return TagApiDeploymentRevisionRequest; + })(); + + v1.ListApiDeploymentRevisionsRequest = (function() { + + /** + * Properties of a ListApiDeploymentRevisionsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApiDeploymentRevisionsRequest + * @property {string|null} [name] ListApiDeploymentRevisionsRequest name + * @property {number|null} [pageSize] ListApiDeploymentRevisionsRequest pageSize + * @property {string|null} [pageToken] ListApiDeploymentRevisionsRequest pageToken + */ + + /** + * Constructs a new ListApiDeploymentRevisionsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApiDeploymentRevisionsRequest. + * @implements IListApiDeploymentRevisionsRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest=} [properties] Properties to set + */ + function ListApiDeploymentRevisionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApiDeploymentRevisionsRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @instance + */ + ListApiDeploymentRevisionsRequest.prototype.name = ""; + + /** + * ListApiDeploymentRevisionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @instance + */ + ListApiDeploymentRevisionsRequest.prototype.pageSize = 0; + + /** + * ListApiDeploymentRevisionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @instance + */ + ListApiDeploymentRevisionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListApiDeploymentRevisionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest} ListApiDeploymentRevisionsRequest instance + */ + ListApiDeploymentRevisionsRequest.create = function create(properties) { + return new ListApiDeploymentRevisionsRequest(properties); + }; + + /** + * Encodes the specified ListApiDeploymentRevisionsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest} message ListApiDeploymentRevisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiDeploymentRevisionsRequest.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.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 ListApiDeploymentRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest} message ListApiDeploymentRevisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiDeploymentRevisionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiDeploymentRevisionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest} ListApiDeploymentRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiDeploymentRevisionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = 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 ListApiDeploymentRevisionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest} ListApiDeploymentRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiDeploymentRevisionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiDeploymentRevisionsRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiDeploymentRevisionsRequest.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.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 ListApiDeploymentRevisionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest} ListApiDeploymentRevisionsRequest + */ + ListApiDeploymentRevisionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest(); + if (object.name != null) + message.name = String(object.name); + 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 ListApiDeploymentRevisionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest} message ListApiDeploymentRevisionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiDeploymentRevisionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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 ListApiDeploymentRevisionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListApiDeploymentRevisionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiDeploymentRevisionsRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiDeploymentRevisionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest"; + }; + + return ListApiDeploymentRevisionsRequest; + })(); + + v1.ListApiDeploymentRevisionsResponse = (function() { + + /** + * Properties of a ListApiDeploymentRevisionsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListApiDeploymentRevisionsResponse + * @property {Array.|null} [apiDeployments] ListApiDeploymentRevisionsResponse apiDeployments + * @property {string|null} [nextPageToken] ListApiDeploymentRevisionsResponse nextPageToken + */ + + /** + * Constructs a new ListApiDeploymentRevisionsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListApiDeploymentRevisionsResponse. + * @implements IListApiDeploymentRevisionsResponse + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse=} [properties] Properties to set + */ + function ListApiDeploymentRevisionsResponse(properties) { + this.apiDeployments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListApiDeploymentRevisionsResponse apiDeployments. + * @member {Array.} apiDeployments + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @instance + */ + ListApiDeploymentRevisionsResponse.prototype.apiDeployments = $util.emptyArray; + + /** + * ListApiDeploymentRevisionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @instance + */ + ListApiDeploymentRevisionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListApiDeploymentRevisionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse} ListApiDeploymentRevisionsResponse instance + */ + ListApiDeploymentRevisionsResponse.create = function create(properties) { + return new ListApiDeploymentRevisionsResponse(properties); + }; + + /** + * Encodes the specified ListApiDeploymentRevisionsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse} message ListApiDeploymentRevisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiDeploymentRevisionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiDeployments != null && message.apiDeployments.length) + for (var i = 0; i < message.apiDeployments.length; ++i) + $root.google.cloud.apigeeregistry.v1.ApiDeployment.encode(message.apiDeployments[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 ListApiDeploymentRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse} message ListApiDeploymentRevisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListApiDeploymentRevisionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListApiDeploymentRevisionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse} ListApiDeploymentRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiDeploymentRevisionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.apiDeployments && message.apiDeployments.length)) + message.apiDeployments = []; + message.apiDeployments.push($root.google.cloud.apigeeregistry.v1.ApiDeployment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListApiDeploymentRevisionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse} ListApiDeploymentRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListApiDeploymentRevisionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListApiDeploymentRevisionsResponse message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListApiDeploymentRevisionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiDeployments != null && message.hasOwnProperty("apiDeployments")) { + if (!Array.isArray(message.apiDeployments)) + return "apiDeployments: array expected"; + for (var i = 0; i < message.apiDeployments.length; ++i) { + var error = $root.google.cloud.apigeeregistry.v1.ApiDeployment.verify(message.apiDeployments[i]); + if (error) + return "apiDeployments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListApiDeploymentRevisionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse} ListApiDeploymentRevisionsResponse + */ + ListApiDeploymentRevisionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse(); + if (object.apiDeployments) { + if (!Array.isArray(object.apiDeployments)) + throw TypeError(".google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse.apiDeployments: array expected"); + message.apiDeployments = []; + for (var i = 0; i < object.apiDeployments.length; ++i) { + if (typeof object.apiDeployments[i] !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse.apiDeployments: object expected"); + message.apiDeployments[i] = $root.google.cloud.apigeeregistry.v1.ApiDeployment.fromObject(object.apiDeployments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListApiDeploymentRevisionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse} message ListApiDeploymentRevisionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListApiDeploymentRevisionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.apiDeployments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.apiDeployments && message.apiDeployments.length) { + object.apiDeployments = []; + for (var j = 0; j < message.apiDeployments.length; ++j) + object.apiDeployments[j] = $root.google.cloud.apigeeregistry.v1.ApiDeployment.toObject(message.apiDeployments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListApiDeploymentRevisionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListApiDeploymentRevisionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListApiDeploymentRevisionsResponse + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListApiDeploymentRevisionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse"; + }; + + return ListApiDeploymentRevisionsResponse; + })(); + + v1.RollbackApiDeploymentRequest = (function() { + + /** + * Properties of a RollbackApiDeploymentRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IRollbackApiDeploymentRequest + * @property {string|null} [name] RollbackApiDeploymentRequest name + * @property {string|null} [revisionId] RollbackApiDeploymentRequest revisionId + */ + + /** + * Constructs a new RollbackApiDeploymentRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a RollbackApiDeploymentRequest. + * @implements IRollbackApiDeploymentRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest=} [properties] Properties to set + */ + function RollbackApiDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RollbackApiDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @instance + */ + RollbackApiDeploymentRequest.prototype.name = ""; + + /** + * RollbackApiDeploymentRequest revisionId. + * @member {string} revisionId + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @instance + */ + RollbackApiDeploymentRequest.prototype.revisionId = ""; + + /** + * Creates a new RollbackApiDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest} RollbackApiDeploymentRequest instance + */ + RollbackApiDeploymentRequest.create = function create(properties) { + return new RollbackApiDeploymentRequest(properties); + }; + + /** + * Encodes the specified RollbackApiDeploymentRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest} message RollbackApiDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackApiDeploymentRequest.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.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.revisionId); + return writer; + }; + + /** + * Encodes the specified RollbackApiDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest} message RollbackApiDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackApiDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RollbackApiDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest} RollbackApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackApiDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.revisionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RollbackApiDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest} RollbackApiDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackApiDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RollbackApiDeploymentRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RollbackApiDeploymentRequest.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.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + return null; + }; + + /** + * Creates a RollbackApiDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest} RollbackApiDeploymentRequest + */ + RollbackApiDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + return message; + }; + + /** + * Creates a plain object from a RollbackApiDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @static + * @param {google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest} message RollbackApiDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RollbackApiDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.revisionId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + return object; + }; + + /** + * Converts this RollbackApiDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + RollbackApiDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RollbackApiDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RollbackApiDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest"; + }; + + return RollbackApiDeploymentRequest; + })(); + + v1.DeleteApiDeploymentRevisionRequest = (function() { + + /** + * Properties of a DeleteApiDeploymentRevisionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IDeleteApiDeploymentRevisionRequest + * @property {string|null} [name] DeleteApiDeploymentRevisionRequest name + */ + + /** + * Constructs a new DeleteApiDeploymentRevisionRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a DeleteApiDeploymentRevisionRequest. + * @implements IDeleteApiDeploymentRevisionRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest=} [properties] Properties to set + */ + function DeleteApiDeploymentRevisionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteApiDeploymentRevisionRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest + * @instance + */ + DeleteApiDeploymentRevisionRequest.prototype.name = ""; + + /** + * Creates a new DeleteApiDeploymentRevisionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest} DeleteApiDeploymentRevisionRequest instance + */ + DeleteApiDeploymentRevisionRequest.create = function create(properties) { + return new DeleteApiDeploymentRevisionRequest(properties); + }; + + /** + * Encodes the specified DeleteApiDeploymentRevisionRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest} message DeleteApiDeploymentRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiDeploymentRevisionRequest.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 DeleteApiDeploymentRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest} message DeleteApiDeploymentRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteApiDeploymentRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteApiDeploymentRevisionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest} DeleteApiDeploymentRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiDeploymentRevisionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest(); + 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 DeleteApiDeploymentRevisionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest} DeleteApiDeploymentRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteApiDeploymentRevisionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteApiDeploymentRevisionRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteApiDeploymentRevisionRequest.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 DeleteApiDeploymentRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest} DeleteApiDeploymentRevisionRequest + */ + DeleteApiDeploymentRevisionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteApiDeploymentRevisionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest + * @static + * @param {google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest} message DeleteApiDeploymentRevisionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteApiDeploymentRevisionRequest.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 DeleteApiDeploymentRevisionRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteApiDeploymentRevisionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteApiDeploymentRevisionRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteApiDeploymentRevisionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest"; + }; + + return DeleteApiDeploymentRevisionRequest; + })(); + + v1.ListArtifactsRequest = (function() { + + /** + * Properties of a ListArtifactsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListArtifactsRequest + * @property {string|null} [parent] ListArtifactsRequest parent + * @property {number|null} [pageSize] ListArtifactsRequest pageSize + * @property {string|null} [pageToken] ListArtifactsRequest pageToken + * @property {string|null} [filter] ListArtifactsRequest filter + */ + + /** + * Constructs a new ListArtifactsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListArtifactsRequest. + * @implements IListArtifactsRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListArtifactsRequest=} [properties] Properties to set + */ + function ListArtifactsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListArtifactsRequest parent. + * @member {string} parent + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @instance + */ + ListArtifactsRequest.prototype.parent = ""; + + /** + * ListArtifactsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @instance + */ + ListArtifactsRequest.prototype.pageSize = 0; + + /** + * ListArtifactsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @instance + */ + ListArtifactsRequest.prototype.pageToken = ""; + + /** + * ListArtifactsRequest filter. + * @member {string} filter + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @instance + */ + ListArtifactsRequest.prototype.filter = ""; + + /** + * Creates a new ListArtifactsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListArtifactsRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListArtifactsRequest} ListArtifactsRequest instance + */ + ListArtifactsRequest.create = function create(properties) { + return new ListArtifactsRequest(properties); + }; + + /** + * Encodes the specified ListArtifactsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListArtifactsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListArtifactsRequest} message ListArtifactsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListArtifactsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListArtifactsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListArtifactsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IListArtifactsRequest} message ListArtifactsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListArtifactsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListArtifactsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListArtifactsRequest} ListArtifactsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListArtifactsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListArtifactsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListArtifactsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListArtifactsRequest} ListArtifactsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListArtifactsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListArtifactsRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListArtifactsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListArtifactsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListArtifactsRequest} ListArtifactsRequest + */ + ListArtifactsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListArtifactsRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListArtifactsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListArtifactsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ListArtifactsRequest} message ListArtifactsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListArtifactsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListArtifactsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @instance + * @returns {Object.} JSON object + */ + ListArtifactsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListArtifactsRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListArtifactsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListArtifactsRequest"; + }; + + return ListArtifactsRequest; + })(); + + v1.ListArtifactsResponse = (function() { + + /** + * Properties of a ListArtifactsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IListArtifactsResponse + * @property {Array.|null} [artifacts] ListArtifactsResponse artifacts + * @property {string|null} [nextPageToken] ListArtifactsResponse nextPageToken + */ + + /** + * Constructs a new ListArtifactsResponse. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ListArtifactsResponse. + * @implements IListArtifactsResponse + * @constructor + * @param {google.cloud.apigeeregistry.v1.IListArtifactsResponse=} [properties] Properties to set + */ + function ListArtifactsResponse(properties) { + this.artifacts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListArtifactsResponse artifacts. + * @member {Array.} artifacts + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @instance + */ + ListArtifactsResponse.prototype.artifacts = $util.emptyArray; + + /** + * ListArtifactsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @instance + */ + ListArtifactsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListArtifactsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListArtifactsResponse=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ListArtifactsResponse} ListArtifactsResponse instance + */ + ListArtifactsResponse.create = function create(properties) { + return new ListArtifactsResponse(properties); + }; + + /** + * Encodes the specified ListArtifactsResponse message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListArtifactsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListArtifactsResponse} message ListArtifactsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListArtifactsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.artifacts != null && message.artifacts.length) + for (var i = 0; i < message.artifacts.length; ++i) + $root.google.cloud.apigeeregistry.v1.Artifact.encode(message.artifacts[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 ListArtifactsResponse message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ListArtifactsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.IListArtifactsResponse} message ListArtifactsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListArtifactsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListArtifactsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ListArtifactsResponse} ListArtifactsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListArtifactsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ListArtifactsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.artifacts && message.artifacts.length)) + message.artifacts = []; + message.artifacts.push($root.google.cloud.apigeeregistry.v1.Artifact.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListArtifactsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ListArtifactsResponse} ListArtifactsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListArtifactsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListArtifactsResponse message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListArtifactsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.artifacts != null && message.hasOwnProperty("artifacts")) { + if (!Array.isArray(message.artifacts)) + return "artifacts: array expected"; + for (var i = 0; i < message.artifacts.length; ++i) { + var error = $root.google.cloud.apigeeregistry.v1.Artifact.verify(message.artifacts[i]); + if (error) + return "artifacts." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListArtifactsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ListArtifactsResponse} ListArtifactsResponse + */ + ListArtifactsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ListArtifactsResponse) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ListArtifactsResponse(); + if (object.artifacts) { + if (!Array.isArray(object.artifacts)) + throw TypeError(".google.cloud.apigeeregistry.v1.ListArtifactsResponse.artifacts: array expected"); + message.artifacts = []; + for (var i = 0; i < object.artifacts.length; ++i) { + if (typeof object.artifacts[i] !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ListArtifactsResponse.artifacts: object expected"); + message.artifacts[i] = $root.google.cloud.apigeeregistry.v1.Artifact.fromObject(object.artifacts[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListArtifactsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @static + * @param {google.cloud.apigeeregistry.v1.ListArtifactsResponse} message ListArtifactsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListArtifactsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.artifacts = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.artifacts && message.artifacts.length) { + object.artifacts = []; + for (var j = 0; j < message.artifacts.length; ++j) + object.artifacts[j] = $root.google.cloud.apigeeregistry.v1.Artifact.toObject(message.artifacts[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListArtifactsResponse to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @instance + * @returns {Object.} JSON object + */ + ListArtifactsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListArtifactsResponse + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ListArtifactsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListArtifactsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ListArtifactsResponse"; + }; + + return ListArtifactsResponse; + })(); + + v1.GetArtifactRequest = (function() { + + /** + * Properties of a GetArtifactRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IGetArtifactRequest + * @property {string|null} [name] GetArtifactRequest name + */ + + /** + * Constructs a new GetArtifactRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a GetArtifactRequest. + * @implements IGetArtifactRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IGetArtifactRequest=} [properties] Properties to set + */ + function GetArtifactRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetArtifactRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.GetArtifactRequest + * @instance + */ + GetArtifactRequest.prototype.name = ""; + + /** + * Creates a new GetArtifactRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.GetArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetArtifactRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.GetArtifactRequest} GetArtifactRequest instance + */ + GetArtifactRequest.create = function create(properties) { + return new GetArtifactRequest(properties); + }; + + /** + * Encodes the specified GetArtifactRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetArtifactRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.GetArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetArtifactRequest} message GetArtifactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetArtifactRequest.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 GetArtifactRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetArtifactRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetArtifactRequest} message GetArtifactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetArtifactRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetArtifactRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.GetArtifactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.GetArtifactRequest} GetArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetArtifactRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.GetArtifactRequest(); + 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 GetArtifactRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetArtifactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.GetArtifactRequest} GetArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetArtifactRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetArtifactRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.GetArtifactRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetArtifactRequest.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 GetArtifactRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.GetArtifactRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.GetArtifactRequest} GetArtifactRequest + */ + GetArtifactRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.GetArtifactRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.GetArtifactRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetArtifactRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.GetArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.GetArtifactRequest} message GetArtifactRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetArtifactRequest.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 GetArtifactRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.GetArtifactRequest + * @instance + * @returns {Object.} JSON object + */ + GetArtifactRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetArtifactRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.GetArtifactRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetArtifactRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.GetArtifactRequest"; + }; + + return GetArtifactRequest; + })(); + + v1.GetArtifactContentsRequest = (function() { + + /** + * Properties of a GetArtifactContentsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IGetArtifactContentsRequest + * @property {string|null} [name] GetArtifactContentsRequest name + */ + + /** + * Constructs a new GetArtifactContentsRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a GetArtifactContentsRequest. + * @implements IGetArtifactContentsRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest=} [properties] Properties to set + */ + function GetArtifactContentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetArtifactContentsRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.GetArtifactContentsRequest + * @instance + */ + GetArtifactContentsRequest.prototype.name = ""; + + /** + * Creates a new GetArtifactContentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.GetArtifactContentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.GetArtifactContentsRequest} GetArtifactContentsRequest instance + */ + GetArtifactContentsRequest.create = function create(properties) { + return new GetArtifactContentsRequest(properties); + }; + + /** + * Encodes the specified GetArtifactContentsRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetArtifactContentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.GetArtifactContentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest} message GetArtifactContentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetArtifactContentsRequest.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 GetArtifactContentsRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.GetArtifactContentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetArtifactContentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest} message GetArtifactContentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetArtifactContentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetArtifactContentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.GetArtifactContentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.GetArtifactContentsRequest} GetArtifactContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetArtifactContentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest(); + 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 GetArtifactContentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.GetArtifactContentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.GetArtifactContentsRequest} GetArtifactContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetArtifactContentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetArtifactContentsRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.GetArtifactContentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetArtifactContentsRequest.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 GetArtifactContentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.GetArtifactContentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.GetArtifactContentsRequest} GetArtifactContentsRequest + */ + GetArtifactContentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetArtifactContentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.GetArtifactContentsRequest + * @static + * @param {google.cloud.apigeeregistry.v1.GetArtifactContentsRequest} message GetArtifactContentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetArtifactContentsRequest.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 GetArtifactContentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.GetArtifactContentsRequest + * @instance + * @returns {Object.} JSON object + */ + GetArtifactContentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetArtifactContentsRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.GetArtifactContentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetArtifactContentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.GetArtifactContentsRequest"; + }; + + return GetArtifactContentsRequest; + })(); + + v1.CreateArtifactRequest = (function() { + + /** + * Properties of a CreateArtifactRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface ICreateArtifactRequest + * @property {string|null} [parent] CreateArtifactRequest parent + * @property {google.cloud.apigeeregistry.v1.IArtifact|null} [artifact] CreateArtifactRequest artifact + * @property {string|null} [artifactId] CreateArtifactRequest artifactId + */ + + /** + * Constructs a new CreateArtifactRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a CreateArtifactRequest. + * @implements ICreateArtifactRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.ICreateArtifactRequest=} [properties] Properties to set + */ + function CreateArtifactRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateArtifactRequest parent. + * @member {string} parent + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @instance + */ + CreateArtifactRequest.prototype.parent = ""; + + /** + * CreateArtifactRequest artifact. + * @member {google.cloud.apigeeregistry.v1.IArtifact|null|undefined} artifact + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @instance + */ + CreateArtifactRequest.prototype.artifact = null; + + /** + * CreateArtifactRequest artifactId. + * @member {string} artifactId + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @instance + */ + CreateArtifactRequest.prototype.artifactId = ""; + + /** + * Creates a new CreateArtifactRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateArtifactRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.CreateArtifactRequest} CreateArtifactRequest instance + */ + CreateArtifactRequest.create = function create(properties) { + return new CreateArtifactRequest(properties); + }; + + /** + * Encodes the specified CreateArtifactRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateArtifactRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateArtifactRequest} message CreateArtifactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateArtifactRequest.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.artifact != null && Object.hasOwnProperty.call(message, "artifact")) + $root.google.cloud.apigeeregistry.v1.Artifact.encode(message.artifact, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.artifactId != null && Object.hasOwnProperty.call(message, "artifactId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.artifactId); + return writer; + }; + + /** + * Encodes the specified CreateArtifactRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.CreateArtifactRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ICreateArtifactRequest} message CreateArtifactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateArtifactRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateArtifactRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.CreateArtifactRequest} CreateArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateArtifactRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.CreateArtifactRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.artifact = $root.google.cloud.apigeeregistry.v1.Artifact.decode(reader, reader.uint32()); + break; + } + case 3: { + message.artifactId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateArtifactRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.CreateArtifactRequest} CreateArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateArtifactRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateArtifactRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateArtifactRequest.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.artifact != null && message.hasOwnProperty("artifact")) { + var error = $root.google.cloud.apigeeregistry.v1.Artifact.verify(message.artifact); + if (error) + return "artifact." + error; + } + if (message.artifactId != null && message.hasOwnProperty("artifactId")) + if (!$util.isString(message.artifactId)) + return "artifactId: string expected"; + return null; + }; + + /** + * Creates a CreateArtifactRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.CreateArtifactRequest} CreateArtifactRequest + */ + CreateArtifactRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.CreateArtifactRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.CreateArtifactRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.artifact != null) { + if (typeof object.artifact !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.CreateArtifactRequest.artifact: object expected"); + message.artifact = $root.google.cloud.apigeeregistry.v1.Artifact.fromObject(object.artifact); + } + if (object.artifactId != null) + message.artifactId = String(object.artifactId); + return message; + }; + + /** + * Creates a plain object from a CreateArtifactRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.CreateArtifactRequest} message CreateArtifactRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateArtifactRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.artifact = null; + object.artifactId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.artifact != null && message.hasOwnProperty("artifact")) + object.artifact = $root.google.cloud.apigeeregistry.v1.Artifact.toObject(message.artifact, options); + if (message.artifactId != null && message.hasOwnProperty("artifactId")) + object.artifactId = message.artifactId; + return object; + }; + + /** + * Converts this CreateArtifactRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @instance + * @returns {Object.} JSON object + */ + CreateArtifactRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateArtifactRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.CreateArtifactRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateArtifactRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.CreateArtifactRequest"; + }; + + return CreateArtifactRequest; + })(); + + v1.ReplaceArtifactRequest = (function() { + + /** + * Properties of a ReplaceArtifactRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IReplaceArtifactRequest + * @property {google.cloud.apigeeregistry.v1.IArtifact|null} [artifact] ReplaceArtifactRequest artifact + */ + + /** + * Constructs a new ReplaceArtifactRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a ReplaceArtifactRequest. + * @implements IReplaceArtifactRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IReplaceArtifactRequest=} [properties] Properties to set + */ + function ReplaceArtifactRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReplaceArtifactRequest artifact. + * @member {google.cloud.apigeeregistry.v1.IArtifact|null|undefined} artifact + * @memberof google.cloud.apigeeregistry.v1.ReplaceArtifactRequest + * @instance + */ + ReplaceArtifactRequest.prototype.artifact = null; + + /** + * Creates a new ReplaceArtifactRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.ReplaceArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IReplaceArtifactRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.ReplaceArtifactRequest} ReplaceArtifactRequest instance + */ + ReplaceArtifactRequest.create = function create(properties) { + return new ReplaceArtifactRequest(properties); + }; + + /** + * Encodes the specified ReplaceArtifactRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.ReplaceArtifactRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.ReplaceArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IReplaceArtifactRequest} message ReplaceArtifactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplaceArtifactRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.artifact != null && Object.hasOwnProperty.call(message, "artifact")) + $root.google.cloud.apigeeregistry.v1.Artifact.encode(message.artifact, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReplaceArtifactRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.ReplaceArtifactRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ReplaceArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IReplaceArtifactRequest} message ReplaceArtifactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplaceArtifactRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplaceArtifactRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.ReplaceArtifactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.ReplaceArtifactRequest} ReplaceArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplaceArtifactRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.artifact = $root.google.cloud.apigeeregistry.v1.Artifact.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplaceArtifactRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.ReplaceArtifactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.ReplaceArtifactRequest} ReplaceArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplaceArtifactRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplaceArtifactRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.ReplaceArtifactRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplaceArtifactRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.artifact != null && message.hasOwnProperty("artifact")) { + var error = $root.google.cloud.apigeeregistry.v1.Artifact.verify(message.artifact); + if (error) + return "artifact." + error; + } + return null; + }; + + /** + * Creates a ReplaceArtifactRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.ReplaceArtifactRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.ReplaceArtifactRequest} ReplaceArtifactRequest + */ + ReplaceArtifactRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest(); + if (object.artifact != null) { + if (typeof object.artifact !== "object") + throw TypeError(".google.cloud.apigeeregistry.v1.ReplaceArtifactRequest.artifact: object expected"); + message.artifact = $root.google.cloud.apigeeregistry.v1.Artifact.fromObject(object.artifact); + } + return message; + }; + + /** + * Creates a plain object from a ReplaceArtifactRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.ReplaceArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.ReplaceArtifactRequest} message ReplaceArtifactRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplaceArtifactRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.artifact = null; + if (message.artifact != null && message.hasOwnProperty("artifact")) + object.artifact = $root.google.cloud.apigeeregistry.v1.Artifact.toObject(message.artifact, options); + return object; + }; + + /** + * Converts this ReplaceArtifactRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.ReplaceArtifactRequest + * @instance + * @returns {Object.} JSON object + */ + ReplaceArtifactRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReplaceArtifactRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.ReplaceArtifactRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReplaceArtifactRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.ReplaceArtifactRequest"; + }; + + return ReplaceArtifactRequest; + })(); + + v1.DeleteArtifactRequest = (function() { + + /** + * Properties of a DeleteArtifactRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @interface IDeleteArtifactRequest + * @property {string|null} [name] DeleteArtifactRequest name + */ + + /** + * Constructs a new DeleteArtifactRequest. + * @memberof google.cloud.apigeeregistry.v1 + * @classdesc Represents a DeleteArtifactRequest. + * @implements IDeleteArtifactRequest + * @constructor + * @param {google.cloud.apigeeregistry.v1.IDeleteArtifactRequest=} [properties] Properties to set + */ + function DeleteArtifactRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteArtifactRequest name. + * @member {string} name + * @memberof google.cloud.apigeeregistry.v1.DeleteArtifactRequest + * @instance + */ + DeleteArtifactRequest.prototype.name = ""; + + /** + * Creates a new DeleteArtifactRequest instance using the specified properties. + * @function create + * @memberof google.cloud.apigeeregistry.v1.DeleteArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteArtifactRequest=} [properties] Properties to set + * @returns {google.cloud.apigeeregistry.v1.DeleteArtifactRequest} DeleteArtifactRequest instance + */ + DeleteArtifactRequest.create = function create(properties) { + return new DeleteArtifactRequest(properties); + }; + + /** + * Encodes the specified DeleteArtifactRequest message. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteArtifactRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.apigeeregistry.v1.DeleteArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteArtifactRequest} message DeleteArtifactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteArtifactRequest.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 DeleteArtifactRequest message, length delimited. Does not implicitly {@link google.cloud.apigeeregistry.v1.DeleteArtifactRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.IDeleteArtifactRequest} message DeleteArtifactRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteArtifactRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteArtifactRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.apigeeregistry.v1.DeleteArtifactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.apigeeregistry.v1.DeleteArtifactRequest} DeleteArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteArtifactRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.apigeeregistry.v1.DeleteArtifactRequest(); + 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 DeleteArtifactRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.apigeeregistry.v1.DeleteArtifactRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.apigeeregistry.v1.DeleteArtifactRequest} DeleteArtifactRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteArtifactRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteArtifactRequest message. + * @function verify + * @memberof google.cloud.apigeeregistry.v1.DeleteArtifactRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteArtifactRequest.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 DeleteArtifactRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.apigeeregistry.v1.DeleteArtifactRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.apigeeregistry.v1.DeleteArtifactRequest} DeleteArtifactRequest + */ + DeleteArtifactRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.apigeeregistry.v1.DeleteArtifactRequest) + return object; + var message = new $root.google.cloud.apigeeregistry.v1.DeleteArtifactRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteArtifactRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.apigeeregistry.v1.DeleteArtifactRequest + * @static + * @param {google.cloud.apigeeregistry.v1.DeleteArtifactRequest} message DeleteArtifactRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteArtifactRequest.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 DeleteArtifactRequest to JSON. + * @function toJSON + * @memberof google.cloud.apigeeregistry.v1.DeleteArtifactRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteArtifactRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteArtifactRequest + * @function getTypeUrl + * @memberof google.cloud.apigeeregistry.v1.DeleteArtifactRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteArtifactRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.apigeeregistry.v1.DeleteArtifactRequest"; + }; + + return DeleteArtifactRequest; + })(); + + return v1; + })(); + + return apigeeregistry; + })(); + + 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 + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + api.HttpBody = (function() { + + /** + * Properties of a HttpBody. + * @memberof google.api + * @interface IHttpBody + * @property {string|null} [contentType] HttpBody contentType + * @property {Uint8Array|null} [data] HttpBody data + * @property {Array.|null} [extensions] HttpBody extensions + */ + + /** + * Constructs a new HttpBody. + * @memberof google.api + * @classdesc Represents a HttpBody. + * @implements IHttpBody + * @constructor + * @param {google.api.IHttpBody=} [properties] Properties to set + */ + function HttpBody(properties) { + this.extensions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpBody contentType. + * @member {string} contentType + * @memberof google.api.HttpBody + * @instance + */ + HttpBody.prototype.contentType = ""; + + /** + * HttpBody data. + * @member {Uint8Array} data + * @memberof google.api.HttpBody + * @instance + */ + HttpBody.prototype.data = $util.newBuffer([]); + + /** + * HttpBody extensions. + * @member {Array.} extensions + * @memberof google.api.HttpBody + * @instance + */ + HttpBody.prototype.extensions = $util.emptyArray; + + /** + * Creates a new HttpBody instance using the specified properties. + * @function create + * @memberof google.api.HttpBody + * @static + * @param {google.api.IHttpBody=} [properties] Properties to set + * @returns {google.api.HttpBody} HttpBody instance + */ + HttpBody.create = function create(properties) { + return new HttpBody(properties); + }; + + /** + * Encodes the specified HttpBody message. Does not implicitly {@link google.api.HttpBody.verify|verify} messages. + * @function encode + * @memberof google.api.HttpBody + * @static + * @param {google.api.IHttpBody} message HttpBody message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpBody.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.contentType); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + if (message.extensions != null && message.extensions.length) + for (var i = 0; i < message.extensions.length; ++i) + $root.google.protobuf.Any.encode(message.extensions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HttpBody message, length delimited. Does not implicitly {@link google.api.HttpBody.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpBody + * @static + * @param {google.api.IHttpBody} message HttpBody message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpBody.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpBody message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpBody + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpBody} HttpBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpBody.decode = function 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.HttpBody(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.contentType = reader.string(); + break; + } + case 2: { + message.data = reader.bytes(); + break; + } + case 3: { + if (!(message.extensions && message.extensions.length)) + message.extensions = []; + message.extensions.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpBody message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpBody + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpBody} HttpBody + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpBody.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpBody message. + * @function verify + * @memberof google.api.HttpBody + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpBody.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contentType != null && message.hasOwnProperty("contentType")) + if (!$util.isString(message.contentType)) + return "contentType: string expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.extensions != null && message.hasOwnProperty("extensions")) { + if (!Array.isArray(message.extensions)) + return "extensions: array expected"; + for (var i = 0; i < message.extensions.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.extensions[i]); + if (error) + return "extensions." + error; + } + } + return null; + }; + + /** + * Creates a HttpBody message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpBody + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpBody} HttpBody + */ + HttpBody.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpBody) + return object; + var message = new $root.google.api.HttpBody(); + if (object.contentType != null) + message.contentType = String(object.contentType); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length >= 0) + message.data = object.data; + if (object.extensions) { + if (!Array.isArray(object.extensions)) + throw TypeError(".google.api.HttpBody.extensions: array expected"); + message.extensions = []; + for (var i = 0; i < object.extensions.length; ++i) { + if (typeof object.extensions[i] !== "object") + throw TypeError(".google.api.HttpBody.extensions: object expected"); + message.extensions[i] = $root.google.protobuf.Any.fromObject(object.extensions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpBody message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpBody + * @static + * @param {google.api.HttpBody} message HttpBody + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpBody.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.extensions = []; + if (options.defaults) { + object.contentType = ""; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = message.contentType; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.extensions && message.extensions.length) { + object.extensions = []; + for (var j = 0; j < message.extensions.length; ++j) + object.extensions[j] = $root.google.protobuf.Any.toObject(message.extensions[j], options); + } + return object; + }; + + /** + * Converts this HttpBody to JSON. + * @function toJSON + * @memberof google.api.HttpBody + * @instance + * @returns {Object.} JSON object + */ + HttpBody.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpBody + * @function getTypeUrl + * @memberof google.api.HttpBody + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpBody.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpBody"; + }; + + return HttpBody; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {string|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 13: { + message.edition = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {google.protobuf.FieldOptions.OptionTargetType|null} [target] FieldOptions target + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions target. + * @member {google.protobuf.FieldOptions.OptionTargetType} target + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.target = 0; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.target); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 18: { + message.target = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.target != null && message.hasOwnProperty("target")) + switch (message.target) { + default: + return "target: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + switch (object.target) { + default: + if (typeof object.target === "number") { + message.target = object.target; + break; + } + break; + case "TARGET_TYPE_UNKNOWN": + case 0: + message.target = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.target = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.target = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.target = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.target = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.target = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.target = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.target = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.target = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.target = 9; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.target = options.enums === String ? "TARGET_TYPE_UNKNOWN" : 0; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.target != null && message.hasOwnProperty("target")) + object.target = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.target] === undefined ? message.target : $root.google.protobuf.FieldOptions.OptionTargetType[message.target] : message.target; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-apigeeregistry/protos/protos.json b/packages/google-cloud-apigeeregistry/protos/protos.json new file mode 100644 index 00000000000..d8be1933690 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/protos/protos.json @@ -0,0 +1,3813 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "apigeeregistry": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.ApigeeRegistry.V1", + "go_package": "cloud.google.com/go/apigeeregistry/apiv1/apigeeregistrypb;apigeeregistrypb", + "java_multiple_files": true, + "java_outer_classname": "RegistryServiceProto", + "java_package": "com.google.cloud.apigeeregistry.v1", + "php_namespace": "Google\\Cloud\\ApigeeRegistry\\V1", + "ruby_package": "Google::Cloud::ApigeeRegistry::V1" + }, + "nested": { + "Provisioning": { + "options": { + "(google.api.default_host)": "apigeeregistry.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateInstance": { + "requestType": "CreateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/instances", + "(google.api.http).body": "instance", + "(google.api.method_signature)": "parent,instance,instance_id", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/instances", + "body": "instance" + } + }, + { + "(google.api.method_signature)": "parent,instance,instance_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteInstance": { + "requestType": "DeleteInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/instances/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetInstance": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/instances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "CreateInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "Instance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/Instance" + } + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/Instance" + } + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "target": { + "type": "string", + "id": 3 + }, + "verb": { + "type": "string", + "id": 4 + }, + "statusMessage": { + "type": "string", + "id": 5 + }, + "cancellationRequested": { + "type": "bool", + "id": 6 + }, + "apiVersion": { + "type": "string", + "id": 7 + } + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "apigeeregistry.googleapis.com/Instance", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "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" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "INACTIVE": 1, + "CREATING": 2, + "ACTIVE": 3, + "UPDATING": 4, + "DELETING": 5, + "FAILED": 6 + } + }, + "Config": { + "fields": { + "location": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cmekKeyName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "Api": { + "options": { + "(google.api.resource).type": "apigeeregistry.googleapis.com/Api", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "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" + } + }, + "availability": { + "type": "string", + "id": 6 + }, + "recommendedVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiVersion" + } + }, + "recommendedDeployment": { + "type": "string", + "id": 8, + "options": { + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiDeployment" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 9 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 10 + } + } + }, + "ApiVersion": { + "options": { + "(google.api.resource).type": "apigeeregistry.googleapis.com/ApiVersion", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}/versions/{version}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "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" + } + }, + "state": { + "type": "string", + "id": 6 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 8 + } + } + }, + "ApiSpec": { + "options": { + "(google.api.resource).type": "apigeeregistry.googleapis.com/ApiSpec", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "filename": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "revisionId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revisionCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revisionUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "mimeType": { + "type": "string", + "id": 8 + }, + "sizeBytes": { + "type": "int32", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "hash": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sourceUri": { + "type": "string", + "id": 11 + }, + "contents": { + "type": "bytes", + "id": 12, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 14 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 15 + } + } + }, + "ApiDeployment": { + "options": { + "(google.api.resource).type": "apigeeregistry.googleapis.com/ApiDeployment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "revisionId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revisionCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revisionUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiSpecRevision": { + "type": "string", + "id": 8, + "options": { + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiSpec" + } + }, + "endpointUri": { + "type": "string", + "id": 9 + }, + "externalChannelUri": { + "type": "string", + "id": 10 + }, + "intendedAudience": { + "type": "string", + "id": 11 + }, + "accessGuidance": { + "type": "string", + "id": 12 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 14 + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 15 + } + } + }, + "Artifact": { + "options": { + "(google.api.resource).type": "apigeeregistry.googleapis.com/Artifact", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}/artifacts/{artifact}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "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" + } + }, + "mimeType": { + "type": "string", + "id": 4 + }, + "sizeBytes": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "hash": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "contents": { + "type": "bytes", + "id": 7, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + } + }, + "Registry": { + "options": { + "(google.api.default_host)": "apigeeregistry.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "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" + } + ] + }, + "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" + } + ] + }, + "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" + } + ] + }, + "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" + } + ] + }, + "ListApiVersions": { + "requestType": "ListApiVersionsRequest", + "responseType": "ListApiVersionsResponse", + "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" + } + ] + }, + "GetApiVersion": { + "requestType": "GetApiVersionRequest", + "responseType": "ApiVersion", + "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" + } + ] + }, + "CreateApiVersion": { + "requestType": "CreateApiVersionRequest", + "responseType": "ApiVersion", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apis/*}/versions", + "(google.api.http).body": "api_version", + "(google.api.method_signature)": "parent,api_version,api_version_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/apis/*}/versions", + "body": "api_version" + } + }, + { + "(google.api.method_signature)": "parent,api_version,api_version_id" + } + ] + }, + "UpdateApiVersion": { + "requestType": "UpdateApiVersionRequest", + "responseType": "ApiVersion", + "options": { + "(google.api.http).patch": "/v1/{api_version.name=projects/*/locations/*/apis/*/versions/*}", + "(google.api.http).body": "api_version", + "(google.api.method_signature)": "api_version,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{api_version.name=projects/*/locations/*/apis/*/versions/*}", + "body": "api_version" + } + }, + { + "(google.api.method_signature)": "api_version,update_mask" + } + ] + }, + "DeleteApiVersion": { + "requestType": "DeleteApiVersionRequest", + "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" + } + ] + }, + "ListApiSpecs": { + "requestType": "ListApiSpecsRequest", + "responseType": "ListApiSpecsResponse", + "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" + } + ] + }, + "GetApiSpec": { + "requestType": "GetApiSpecRequest", + "responseType": "ApiSpec", + "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" + } + ] + }, + "GetApiSpecContents": { + "requestType": "GetApiSpecContentsRequest", + "responseType": "google.api.HttpBody", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:getContents", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:getContents" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateApiSpec": { + "requestType": "CreateApiSpecRequest", + "responseType": "ApiSpec", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs", + "(google.api.http).body": "api_spec", + "(google.api.method_signature)": "parent,api_spec,api_spec_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/specs", + "body": "api_spec" + } + }, + { + "(google.api.method_signature)": "parent,api_spec,api_spec_id" + } + ] + }, + "UpdateApiSpec": { + "requestType": "UpdateApiSpecRequest", + "responseType": "ApiSpec", + "options": { + "(google.api.http).patch": "/v1/{api_spec.name=projects/*/locations/*/apis/*/versions/*/specs/*}", + "(google.api.http).body": "api_spec", + "(google.api.method_signature)": "api_spec,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{api_spec.name=projects/*/locations/*/apis/*/versions/*/specs/*}", + "body": "api_spec" + } + }, + { + "(google.api.method_signature)": "api_spec,update_mask" + } + ] + }, + "DeleteApiSpec": { + "requestType": "DeleteApiSpecRequest", + "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" + } + ] + }, + "TagApiSpecRevision": { + "requestType": "TagApiSpecRevisionRequest", + "responseType": "ApiSpec", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:tagRevision", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:tagRevision", + "body": "*" + } + } + ] + }, + "ListApiSpecRevisions": { + "requestType": "ListApiSpecRevisionsRequest", + "responseType": "ListApiSpecRevisionsResponse", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:listRevisions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:listRevisions" + } + } + ] + }, + "RollbackApiSpec": { + "requestType": "RollbackApiSpecRequest", + "responseType": "ApiSpec", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:rollback", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:rollback", + "body": "*" + } + } + ] + }, + "DeleteApiSpecRevision": { + "requestType": "DeleteApiSpecRevisionRequest", + "responseType": "ApiSpec", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:deleteRevision", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*}:deleteRevision" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListApiDeployments": { + "requestType": "ListApiDeploymentsRequest", + "responseType": "ListApiDeploymentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/apis/*}/deployments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/apis/*}/deployments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetApiDeployment": { + "requestType": "GetApiDeploymentRequest", + "responseType": "ApiDeployment", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateApiDeployment": { + "requestType": "CreateApiDeploymentRequest", + "responseType": "ApiDeployment", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/apis/*}/deployments", + "(google.api.http).body": "api_deployment", + "(google.api.method_signature)": "parent,api_deployment,api_deployment_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/apis/*}/deployments", + "body": "api_deployment" + } + }, + { + "(google.api.method_signature)": "parent,api_deployment,api_deployment_id" + } + ] + }, + "UpdateApiDeployment": { + "requestType": "UpdateApiDeploymentRequest", + "responseType": "ApiDeployment", + "options": { + "(google.api.http).patch": "/v1/{api_deployment.name=projects/*/locations/*/apis/*/deployments/*}", + "(google.api.http).body": "api_deployment", + "(google.api.method_signature)": "api_deployment,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{api_deployment.name=projects/*/locations/*/apis/*/deployments/*}", + "body": "api_deployment" + } + }, + { + "(google.api.method_signature)": "api_deployment,update_mask" + } + ] + }, + "DeleteApiDeployment": { + "requestType": "DeleteApiDeploymentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "TagApiDeploymentRevision": { + "requestType": "TagApiDeploymentRevisionRequest", + "responseType": "ApiDeployment", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:tagRevision", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:tagRevision", + "body": "*" + } + } + ] + }, + "ListApiDeploymentRevisions": { + "requestType": "ListApiDeploymentRevisionsRequest", + "responseType": "ListApiDeploymentRevisionsResponse", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:listRevisions" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:listRevisions" + } + } + ] + }, + "RollbackApiDeployment": { + "requestType": "RollbackApiDeploymentRequest", + "responseType": "ApiDeployment", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:rollback", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:rollback", + "body": "*" + } + } + ] + }, + "DeleteApiDeploymentRevision": { + "requestType": "DeleteApiDeploymentRevisionRequest", + "responseType": "ApiDeployment", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:deleteRevision", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/apis/*/deployments/*}:deleteRevision" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListArtifacts": { + "requestType": "ListArtifactsRequest", + "responseType": "ListArtifactsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/artifacts", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/locations/*/apis/*/deployments/*}/artifacts", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/artifacts", + "additional_bindings": [ + { + "get": "/v1/{parent=projects/*/locations/*/apis/*}/artifacts" + }, + { + "get": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/artifacts" + }, + { + "get": "/v1/{parent=projects/*/locations/*/apis/*/versions/*/specs/*}/artifacts" + }, + { + "get": "/v1/{parent=projects/*/locations/*/apis/*/deployments/*}/artifacts" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetArtifact": { + "requestType": "GetArtifactRequest", + "responseType": "Artifact", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/artifacts/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/artifacts/*}", + "additional_bindings": [ + { + "get": "/v1/{name=projects/*/locations/*/apis/*/artifacts/*}" + }, + { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/artifacts/*}" + }, + { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}" + }, + { + "get": "/v1/{name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetArtifactContents": { + "requestType": "GetArtifactContentsRequest", + "responseType": "google.api.HttpBody", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/artifacts/*}:getContents", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}:getContents", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/artifacts/*}:getContents", + "additional_bindings": [ + { + "get": "/v1/{name=projects/*/locations/*/apis/*/artifacts/*}:getContents" + }, + { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/artifacts/*}:getContents" + }, + { + "get": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}:getContents" + }, + { + "get": "/v1/{name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}:getContents" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateArtifact": { + "requestType": "CreateArtifactRequest", + "responseType": "Artifact", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/artifacts", + "(google.api.http).body": "artifact", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/locations/*/apis/*/deployments/*}/artifacts", + "(google.api.http).additional_bindings.body": "artifact", + "(google.api.method_signature)": "parent,artifact,artifact_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/artifacts", + "body": "artifact", + "additional_bindings": [ + { + "post": "/v1/{parent=projects/*/locations/*/apis/*}/artifacts", + "body": "artifact" + }, + { + "post": "/v1/{parent=projects/*/locations/*/apis/*/versions/*}/artifacts", + "body": "artifact" + }, + { + "post": "/v1/{parent=projects/*/locations/*/apis/*/versions/*/specs/*}/artifacts", + "body": "artifact" + }, + { + "post": "/v1/{parent=projects/*/locations/*/apis/*/deployments/*}/artifacts", + "body": "artifact" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,artifact,artifact_id" + } + ] + }, + "ReplaceArtifact": { + "requestType": "ReplaceArtifactRequest", + "responseType": "Artifact", + "options": { + "(google.api.http).put": "/v1/{artifact.name=projects/*/locations/*/artifacts/*}", + "(google.api.http).body": "artifact", + "(google.api.http).additional_bindings.put": "/v1/{artifact.name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}", + "(google.api.http).additional_bindings.body": "artifact", + "(google.api.method_signature)": "artifact" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/v1/{artifact.name=projects/*/locations/*/artifacts/*}", + "body": "artifact", + "additional_bindings": [ + { + "put": "/v1/{artifact.name=projects/*/locations/*/apis/*/artifacts/*}", + "body": "artifact" + }, + { + "put": "/v1/{artifact.name=projects/*/locations/*/apis/*/versions/*/artifacts/*}", + "body": "artifact" + }, + { + "put": "/v1/{artifact.name=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}", + "body": "artifact" + }, + { + "put": "/v1/{artifact.name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}", + "body": "artifact" + } + ] + } + }, + { + "(google.api.method_signature)": "artifact" + } + ] + }, + "DeleteArtifact": { + "requestType": "DeleteArtifactRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/artifacts/*}", + "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/artifacts/*}", + "additional_bindings": [ + { + "delete": "/v1/{name=projects/*/locations/*/apis/*/artifacts/*}" + }, + { + "delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*/artifacts/*}" + }, + { + "delete": "/v1/{name=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}" + }, + { + "delete": "/v1/{name=projects/*/locations/*/apis/*/deployments/*/artifacts/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "ListApisRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apigeeregistry.googleapis.com/Api" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListApisResponse": { + "fields": { + "apis": { + "rule": "repeated", + "type": "Api", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetApiRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/Api" + } + } + } + }, + "CreateApiRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apigeeregistry.googleapis.com/Api" + } + }, + "api": { + "type": "Api", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateApiRequest": { + "fields": { + "api": { + "type": "Api", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "allowMissing": { + "type": "bool", + "id": 3 + } + } + }, + "DeleteApiRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/Api" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "ListApiVersionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apigeeregistry.googleapis.com/ApiVersion" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListApiVersionsResponse": { + "fields": { + "apiVersions": { + "rule": "repeated", + "type": "ApiVersion", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetApiVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiVersion" + } + } + } + }, + "CreateApiVersionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apigeeregistry.googleapis.com/ApiVersion" + } + }, + "apiVersion": { + "type": "ApiVersion", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiVersionId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateApiVersionRequest": { + "fields": { + "apiVersion": { + "type": "ApiVersion", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "allowMissing": { + "type": "bool", + "id": 3 + } + } + }, + "DeleteApiVersionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiVersion" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "ListApiSpecsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apigeeregistry.googleapis.com/ApiSpec" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListApiSpecsResponse": { + "fields": { + "apiSpecs": { + "rule": "repeated", + "type": "ApiSpec", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetApiSpecRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiSpec" + } + } + } + }, + "GetApiSpecContentsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiSpec" + } + } + } + }, + "CreateApiSpecRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apigeeregistry.googleapis.com/ApiSpec" + } + }, + "apiSpec": { + "type": "ApiSpec", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiSpecId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateApiSpecRequest": { + "fields": { + "apiSpec": { + "type": "ApiSpec", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "allowMissing": { + "type": "bool", + "id": 3 + } + } + }, + "DeleteApiSpecRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiSpec" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "TagApiSpecRevisionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiSpec" + } + }, + "tag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListApiSpecRevisionsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiSpec" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListApiSpecRevisionsResponse": { + "fields": { + "apiSpecs": { + "rule": "repeated", + "type": "ApiSpec", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "RollbackApiSpecRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiSpec" + } + }, + "revisionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteApiSpecRevisionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiSpec" + } + } + } + }, + "ListApiDeploymentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apigeeregistry.googleapis.com/ApiDeployment" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListApiDeploymentsResponse": { + "fields": { + "apiDeployments": { + "rule": "repeated", + "type": "ApiDeployment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetApiDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiDeployment" + } + } + } + }, + "CreateApiDeploymentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apigeeregistry.googleapis.com/ApiDeployment" + } + }, + "apiDeployment": { + "type": "ApiDeployment", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiDeploymentId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateApiDeploymentRequest": { + "fields": { + "apiDeployment": { + "type": "ApiDeployment", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "allowMissing": { + "type": "bool", + "id": 3 + } + } + }, + "DeleteApiDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiDeployment" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "TagApiDeploymentRevisionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiDeployment" + } + }, + "tag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListApiDeploymentRevisionsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiDeployment" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListApiDeploymentRevisionsResponse": { + "fields": { + "apiDeployments": { + "rule": "repeated", + "type": "ApiDeployment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "RollbackApiDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiDeployment" + } + }, + "revisionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteApiDeploymentRevisionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/ApiDeployment" + } + } + } + }, + "ListArtifactsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apigeeregistry.googleapis.com/Artifact" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListArtifactsResponse": { + "fields": { + "artifacts": { + "rule": "repeated", + "type": "Artifact", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetArtifactRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/Artifact" + } + } + } + }, + "GetArtifactContentsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/Artifact" + } + } + } + }, + "CreateArtifactRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "apigeeregistry.googleapis.com/Artifact" + } + }, + "artifact": { + "type": "Artifact", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "artifactId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ReplaceArtifactRequest": { + "fields": { + "artifact": { + "type": "Artifact", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteArtifactRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "apigeeregistry.googleapis.com/Artifact" + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/httpbody;httpbody", + "java_multiple_files": true, + "java_outer_classname": "HttpBodyProto", + "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" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "HttpBody": { + "fields": { + "contentType": { + "type": "string", + "id": 1 + }, + "data": { + "type": "bytes", + "id": 2 + }, + "extensions": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "target": { + "type": "OptionTargetType", + "id": 18 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-apigeeregistry/samples/README.md b/packages/google-cloud-apigeeregistry/samples/README.md new file mode 100644 index 00000000000..4fefc6a6a00 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/README.md @@ -0,0 +1,734 @@ +[//]: # "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 + +# [Apigee Registry 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) + * [Provisioning.create_instance](#provisioning.create_instance) + * [Provisioning.delete_instance](#provisioning.delete_instance) + * [Provisioning.get_instance](#provisioning.get_instance) + * [Registry.create_api](#registry.create_api) + * [Registry.create_api_deployment](#registry.create_api_deployment) + * [Registry.create_api_spec](#registry.create_api_spec) + * [Registry.create_api_version](#registry.create_api_version) + * [Registry.create_artifact](#registry.create_artifact) + * [Registry.delete_api](#registry.delete_api) + * [Registry.delete_api_deployment](#registry.delete_api_deployment) + * [Registry.delete_api_deployment_revision](#registry.delete_api_deployment_revision) + * [Registry.delete_api_spec](#registry.delete_api_spec) + * [Registry.delete_api_spec_revision](#registry.delete_api_spec_revision) + * [Registry.delete_api_version](#registry.delete_api_version) + * [Registry.delete_artifact](#registry.delete_artifact) + * [Registry.get_api](#registry.get_api) + * [Registry.get_api_deployment](#registry.get_api_deployment) + * [Registry.get_api_spec](#registry.get_api_spec) + * [Registry.get_api_spec_contents](#registry.get_api_spec_contents) + * [Registry.get_api_version](#registry.get_api_version) + * [Registry.get_artifact](#registry.get_artifact) + * [Registry.get_artifact_contents](#registry.get_artifact_contents) + * [Registry.list_api_deployment_revisions](#registry.list_api_deployment_revisions) + * [Registry.list_api_deployments](#registry.list_api_deployments) + * [Registry.list_api_spec_revisions](#registry.list_api_spec_revisions) + * [Registry.list_api_specs](#registry.list_api_specs) + * [Registry.list_api_versions](#registry.list_api_versions) + * [Registry.list_apis](#registry.list_apis) + * [Registry.list_artifacts](#registry.list_artifacts) + * [Registry.replace_artifact](#registry.replace_artifact) + * [Registry.rollback_api_deployment](#registry.rollback_api_deployment) + * [Registry.rollback_api_spec](#registry.rollback_api_spec) + * [Registry.tag_api_deployment_revision](#registry.tag_api_deployment_revision) + * [Registry.tag_api_spec_revision](#registry.tag_api_spec_revision) + * [Registry.update_api](#registry.update_api) + * [Registry.update_api_deployment](#registry.update_api_deployment) + * [Registry.update_api_spec](#registry.update_api_spec) + * [Registry.update_api_version](#registry.update_api_version) + * [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 + + + +### Provisioning.create_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.create_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-apigeeregistry/samples/generated/v1/provisioning.create_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.create_instance.js` + + +----- + + + + +### Provisioning.delete_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.delete_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-apigeeregistry/samples/generated/v1/provisioning.delete_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.delete_instance.js` + + +----- + + + + +### Provisioning.get_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.get_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-apigeeregistry/samples/generated/v1/provisioning.get_instance.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.get_instance.js` + + +----- + + + + +### Registry.create_api + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.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-apigeeregistry/samples/generated/v1/registry.create_api.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api.js` + + +----- + + + + +### Registry.create_api_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_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-apigeeregistry/samples/generated/v1/registry.create_api_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_deployment.js` + + +----- + + + + +### Registry.create_api_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_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-apigeeregistry/samples/generated/v1/registry.create_api_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_spec.js` + + +----- + + + + +### Registry.create_api_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_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-apigeeregistry/samples/generated/v1/registry.create_api_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_version.js` + + +----- + + + + +### Registry.create_artifact + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_artifact.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-apigeeregistry/samples/generated/v1/registry.create_artifact.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_artifact.js` + + +----- + + + + +### Registry.delete_api + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.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-apigeeregistry/samples/generated/v1/registry.delete_api.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api.js` + + +----- + + + + +### Registry.delete_api_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_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-apigeeregistry/samples/generated/v1/registry.delete_api_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment.js` + + +----- + + + + +### Registry.delete_api_deployment_revision + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment_revision.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-apigeeregistry/samples/generated/v1/registry.delete_api_deployment_revision.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment_revision.js` + + +----- + + + + +### Registry.delete_api_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_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-apigeeregistry/samples/generated/v1/registry.delete_api_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec.js` + + +----- + + + + +### Registry.delete_api_spec_revision + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec_revision.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-apigeeregistry/samples/generated/v1/registry.delete_api_spec_revision.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec_revision.js` + + +----- + + + + +### Registry.delete_api_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_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-apigeeregistry/samples/generated/v1/registry.delete_api_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_version.js` + + +----- + + + + +### Registry.delete_artifact + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_artifact.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-apigeeregistry/samples/generated/v1/registry.delete_artifact.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_artifact.js` + + +----- + + + + +### Registry.get_api + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.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-apigeeregistry/samples/generated/v1/registry.get_api.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api.js` + + +----- + + + + +### Registry.get_api_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_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-apigeeregistry/samples/generated/v1/registry.get_api_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_deployment.js` + + +----- + + + + +### Registry.get_api_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_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-apigeeregistry/samples/generated/v1/registry.get_api_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec.js` + + +----- + + + + +### Registry.get_api_spec_contents + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_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-apigeeregistry/samples/generated/v1/registry.get_api_spec_contents.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec_contents.js` + + +----- + + + + +### Registry.get_api_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_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-apigeeregistry/samples/generated/v1/registry.get_api_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_version.js` + + +----- + + + + +### Registry.get_artifact + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact.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-apigeeregistry/samples/generated/v1/registry.get_artifact.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact.js` + + +----- + + + + +### Registry.get_artifact_contents + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact_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-apigeeregistry/samples/generated/v1/registry.get_artifact_contents.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact_contents.js` + + +----- + + + + +### Registry.list_api_deployment_revisions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployment_revisions.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-apigeeregistry/samples/generated/v1/registry.list_api_deployment_revisions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployment_revisions.js` + + +----- + + + + +### Registry.list_api_deployments + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_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-apigeeregistry/samples/generated/v1/registry.list_api_deployments.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployments.js` + + +----- + + + + +### Registry.list_api_spec_revisions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_spec_revisions.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-apigeeregistry/samples/generated/v1/registry.list_api_spec_revisions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_spec_revisions.js` + + +----- + + + + +### Registry.list_api_specs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_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-apigeeregistry/samples/generated/v1/registry.list_api_specs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_specs.js` + + +----- + + + + +### Registry.list_api_versions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_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-apigeeregistry/samples/generated/v1/registry.list_api_versions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_versions.js` + + +----- + + + + +### Registry.list_apis + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.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-apigeeregistry/samples/generated/v1/registry.list_apis.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_apis.js` + + +----- + + + + +### Registry.list_artifacts + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_artifacts.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-apigeeregistry/samples/generated/v1/registry.list_artifacts.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_artifacts.js` + + +----- + + + + +### Registry.replace_artifact + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.replace_artifact.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-apigeeregistry/samples/generated/v1/registry.replace_artifact.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.replace_artifact.js` + + +----- + + + + +### Registry.rollback_api_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_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-apigeeregistry/samples/generated/v1/registry.rollback_api_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_deployment.js` + + +----- + + + + +### Registry.rollback_api_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_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-apigeeregistry/samples/generated/v1/registry.rollback_api_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_spec.js` + + +----- + + + + +### Registry.tag_api_deployment_revision + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_deployment_revision.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-apigeeregistry/samples/generated/v1/registry.tag_api_deployment_revision.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_deployment_revision.js` + + +----- + + + + +### Registry.tag_api_spec_revision + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_spec_revision.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-apigeeregistry/samples/generated/v1/registry.tag_api_spec_revision.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_spec_revision.js` + + +----- + + + + +### Registry.update_api + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.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-apigeeregistry/samples/generated/v1/registry.update_api.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api.js` + + +----- + + + + +### Registry.update_api_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_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-apigeeregistry/samples/generated/v1/registry.update_api_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_deployment.js` + + +----- + + + + +### Registry.update_api_spec + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_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-apigeeregistry/samples/generated/v1/registry.update_api_spec.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_spec.js` + + +----- + + + + +### Registry.update_api_version + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_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-apigeeregistry/samples/generated/v1/registry.update_api_version.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_version.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-apigeeregistry/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-apigeeregistry/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-apigeeregistry/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/api-hub/get-started-registry-api diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.create_instance.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.create_instance.js new file mode 100644 index 00000000000..b4ca96bdb74 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.create_instance.js @@ -0,0 +1,73 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, instanceId, instance) { + // [START apigeeregistry_v1_generated_Provisioning_CreateInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource of the Instance, of the form: `projects/* /locations/*` + */ + // const parent = 'abc123' + /** + * Required. Identifier to assign to the Instance. Must be unique within scope of the + * parent resource. + */ + // const instanceId = 'abc123' + /** + * Required. The Instance. + */ + // const instance = {} + + // Imports the Apigeeregistry library + const {ProvisioningClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new ProvisioningClient(); + + async function callCreateInstance() { + // Construct request + const request = { + parent, + instanceId, + instance, + }; + + // Run request + const [operation] = await apigeeregistryClient.createInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateInstance(); + // [END apigeeregistry_v1_generated_Provisioning_CreateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.delete_instance.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.delete_instance.js new file mode 100644 index 00000000000..74e702d5023 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.delete_instance.js @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START apigeeregistry_v1_generated_Provisioning_DeleteInstance_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 Instance to delete. + * Format: `projects/* /locations/* /instances/*`. + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {ProvisioningClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new ProvisioningClient(); + + async function callDeleteInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await apigeeregistryClient.deleteInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteInstance(); + // [END apigeeregistry_v1_generated_Provisioning_DeleteInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.get_instance.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.get_instance.js new file mode 100644 index 00000000000..9724a92c2d8 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.get_instance.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START apigeeregistry_v1_generated_Provisioning_GetInstance_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 Instance to retrieve. + * Format: `projects/* /locations/* /instances/*`. + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {ProvisioningClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new ProvisioningClient(); + + async function callGetInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.getInstance(request); + console.log(response); + } + + callGetInstance(); + // [END apigeeregistry_v1_generated_Provisioning_GetInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api.js new file mode 100644 index 00000000000..113640e2ec6 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api.js @@ -0,0 +1,76 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, api, apiId) { + // [START apigeeregistry_v1_generated_Registry_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, which owns this collection of APIs. + * Format: `projects/* /locations/*` + */ + // const parent = 'abc123' + /** + * Required. The API to create. + */ + // const api = {} + /** + * Required. The ID to use for the API, which will become the final component of + * the API's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-/. + * Following AIP-162, IDs must not have the form of a UUID. + */ + // const apiId = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callCreateApi() { + // Construct request + const request = { + parent, + api, + apiId, + }; + + // Run request + const response = await apigeeregistryClient.createApi(request); + console.log(response); + } + + callCreateApi(); + // [END apigeeregistry_v1_generated_Registry_CreateApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_deployment.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_deployment.js new file mode 100644 index 00000000000..7a4c1c845c6 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_deployment.js @@ -0,0 +1,76 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, apiDeployment, apiDeploymentId) { + // [START apigeeregistry_v1_generated_Registry_CreateApiDeployment_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 deployments. + * Format: `projects/* /locations/* /apis/*` + */ + // const parent = 'abc123' + /** + * Required. The deployment to create. + */ + // const apiDeployment = {} + /** + * Required. The ID to use for the deployment, which will become the final component of + * the deployment's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-/. + * Following AIP-162, IDs must not have the form of a UUID. + */ + // const apiDeploymentId = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callCreateApiDeployment() { + // Construct request + const request = { + parent, + apiDeployment, + apiDeploymentId, + }; + + // Run request + const response = await apigeeregistryClient.createApiDeployment(request); + console.log(response); + } + + callCreateApiDeployment(); + // [END apigeeregistry_v1_generated_Registry_CreateApiDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_spec.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_spec.js new file mode 100644 index 00000000000..58b8584700b --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_spec.js @@ -0,0 +1,76 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, apiSpec, apiSpecId) { + // [START apigeeregistry_v1_generated_Registry_CreateApiSpec_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/* /locations/* /apis/* /versions/*` + */ + // const parent = 'abc123' + /** + * Required. The spec to create. + */ + // const apiSpec = {} + /** + * Required. The ID to use for the spec, which will become the final component of + * the spec's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-/. + * Following AIP-162, IDs must not have the form of a UUID. + */ + // const apiSpecId = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callCreateApiSpec() { + // Construct request + const request = { + parent, + apiSpec, + apiSpecId, + }; + + // Run request + const response = await apigeeregistryClient.createApiSpec(request); + console.log(response); + } + + callCreateApiSpec(); + // [END apigeeregistry_v1_generated_Registry_CreateApiSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_version.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_version.js new file mode 100644 index 00000000000..1a5dc3f12dc --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_version.js @@ -0,0 +1,76 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, apiVersion, apiVersionId) { + // [START apigeeregistry_v1_generated_Registry_CreateApiVersion_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 versions. + * Format: `projects/* /locations/* /apis/*` + */ + // const parent = 'abc123' + /** + * Required. The version to create. + */ + // const apiVersion = {} + /** + * Required. The ID to use for the version, which will become the final component of + * the version's resource name. + * This value should be 1-63 characters, and valid characters + * are /[a-z][0-9]-/. + * Following AIP-162, IDs must not have the form of a UUID. + */ + // const apiVersionId = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callCreateApiVersion() { + // Construct request + const request = { + parent, + apiVersion, + apiVersionId, + }; + + // Run request + const response = await apigeeregistryClient.createApiVersion(request); + console.log(response); + } + + callCreateApiVersion(); + // [END apigeeregistry_v1_generated_Registry_CreateApiVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_artifact.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_artifact.js new file mode 100644 index 00000000000..e9052fe1b2e --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_artifact.js @@ -0,0 +1,76 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, artifact, artifactId) { + // [START apigeeregistry_v1_generated_Registry_CreateArtifact_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 artifacts. + * Format: `{parent}` + */ + // const parent = 'abc123' + /** + * Required. The artifact to create. + */ + // const artifact = {} + /** + * Required. The ID to use for the artifact, which will become the final component of + * the artifact's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-/. + * Following AIP-162, IDs must not have the form of a UUID. + */ + // const artifactId = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callCreateArtifact() { + // Construct request + const request = { + parent, + artifact, + artifactId, + }; + + // Run request + const response = await apigeeregistryClient.createArtifact(request); + console.log(response); + } + + callCreateArtifact(); + // [END apigeeregistry_v1_generated_Registry_CreateArtifact_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api.js new file mode 100644 index 00000000000..917b1dd3399 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START apigeeregistry_v1_generated_Registry_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 to delete. + * Format: `projects/* /locations/* /apis/*` + */ + // const name = 'abc123' + /** + * If set to true, any child resources will also be deleted. + * (Otherwise, the request will only work if there are no child resources.) + */ + // const force = true + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callDeleteApi() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.deleteApi(request); + console.log(response); + } + + callDeleteApi(); + // [END apigeeregistry_v1_generated_Registry_DeleteApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment.js new file mode 100644 index 00000000000..863cd8ce339 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START apigeeregistry_v1_generated_Registry_DeleteApiDeployment_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 to delete. + * Format: `projects/* /locations/* /apis/* /deployments/*` + */ + // const name = 'abc123' + /** + * If set to true, any child resources will also be deleted. + * (Otherwise, the request will only work if there are no child resources.) + */ + // const force = true + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callDeleteApiDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.deleteApiDeployment(request); + console.log(response); + } + + callDeleteApiDeployment(); + // [END apigeeregistry_v1_generated_Registry_DeleteApiDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment_revision.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment_revision.js new file mode 100644 index 00000000000..369deb1856c --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment_revision.js @@ -0,0 +1,64 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START apigeeregistry_v1_generated_Registry_DeleteApiDeploymentRevision_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 revision to be deleted, + * with a revision ID explicitly included. + * Example: + * `projects/sample/locations/global/apis/petstore/deployments/prod@c7cfa2a8` + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callDeleteApiDeploymentRevision() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.deleteApiDeploymentRevision(request); + console.log(response); + } + + callDeleteApiDeploymentRevision(); + // [END apigeeregistry_v1_generated_Registry_DeleteApiDeploymentRevision_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec.js new file mode 100644 index 00000000000..15fc88e824c --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START apigeeregistry_v1_generated_Registry_DeleteApiSpec_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/* /locations/* /apis/* /versions/* /specs/*` + */ + // const name = 'abc123' + /** + * If set to true, any child resources will also be deleted. + * (Otherwise, the request will only work if there are no child resources.) + */ + // const force = true + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callDeleteApiSpec() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.deleteApiSpec(request); + console.log(response); + } + + callDeleteApiSpec(); + // [END apigeeregistry_v1_generated_Registry_DeleteApiSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec_revision.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec_revision.js new file mode 100644 index 00000000000..fa2a1e8df18 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec_revision.js @@ -0,0 +1,64 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START apigeeregistry_v1_generated_Registry_DeleteApiSpecRevision_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 revision to be deleted, + * with a revision ID explicitly included. + * Example: + * `projects/sample/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml@c7cfa2a8` + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callDeleteApiSpecRevision() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.deleteApiSpecRevision(request); + console.log(response); + } + + callDeleteApiSpecRevision(); + // [END apigeeregistry_v1_generated_Registry_DeleteApiSpecRevision_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_version.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_version.js new file mode 100644 index 00000000000..7c4454a1053 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_version.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START apigeeregistry_v1_generated_Registry_DeleteApiVersion_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/* /locations/* /apis/* /versions/*` + */ + // const name = 'abc123' + /** + * If set to true, any child resources will also be deleted. + * (Otherwise, the request will only work if there are no child resources.) + */ + // const force = true + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callDeleteApiVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.deleteApiVersion(request); + console.log(response); + } + + callDeleteApiVersion(); + // [END apigeeregistry_v1_generated_Registry_DeleteApiVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_artifact.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_artifact.js new file mode 100644 index 00000000000..99da99af3e5 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_artifact.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START apigeeregistry_v1_generated_Registry_DeleteArtifact_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 artifact to delete. + * Format: `{parent}/artifacts/*` + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callDeleteArtifact() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.deleteArtifact(request); + console.log(response); + } + + callDeleteArtifact(); + // [END apigeeregistry_v1_generated_Registry_DeleteArtifact_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api.js new file mode 100644 index 00000000000..235120454ad --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START apigeeregistry_v1_generated_Registry_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 to retrieve. + * Format: `projects/* /locations/* /apis/*` + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callGetApi() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.getApi(request); + console.log(response); + } + + callGetApi(); + // [END apigeeregistry_v1_generated_Registry_GetApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_deployment.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_deployment.js new file mode 100644 index 00000000000..1414dc571b9 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_deployment.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START apigeeregistry_v1_generated_Registry_GetApiDeployment_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 to retrieve. + * Format: `projects/* /locations/* /apis/* /deployments/*` + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callGetApiDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.getApiDeployment(request); + console.log(response); + } + + callGetApiDeployment(); + // [END apigeeregistry_v1_generated_Registry_GetApiDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec.js new file mode 100644 index 00000000000..e6440349af4 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START apigeeregistry_v1_generated_Registry_GetApiSpec_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/* /locations/* /apis/* /versions/* /specs/*` + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callGetApiSpec() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.getApiSpec(request); + console.log(response); + } + + callGetApiSpec(); + // [END apigeeregistry_v1_generated_Registry_GetApiSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec_contents.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec_contents.js new file mode 100644 index 00000000000..d3f17e4d094 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec_contents.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START apigeeregistry_v1_generated_Registry_GetApiSpecContents_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 should be retrieved. + * Format: `projects/* /locations/* /apis/* /versions/* /specs/*` + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callGetApiSpecContents() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.getApiSpecContents(request); + console.log(response); + } + + callGetApiSpecContents(); + // [END apigeeregistry_v1_generated_Registry_GetApiSpecContents_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_version.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_version.js new file mode 100644 index 00000000000..2a288b39beb --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_version.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START apigeeregistry_v1_generated_Registry_GetApiVersion_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 retrieve. + * Format: `projects/* /locations/* /apis/* /versions/*` + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callGetApiVersion() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.getApiVersion(request); + console.log(response); + } + + callGetApiVersion(); + // [END apigeeregistry_v1_generated_Registry_GetApiVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact.js new file mode 100644 index 00000000000..67eaf70c3fa --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START apigeeregistry_v1_generated_Registry_GetArtifact_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 artifact to retrieve. + * Format: `{parent}/artifacts/*` + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callGetArtifact() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.getArtifact(request); + console.log(response); + } + + callGetArtifact(); + // [END apigeeregistry_v1_generated_Registry_GetArtifact_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact_contents.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact_contents.js new file mode 100644 index 00000000000..ea2d32d2855 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact_contents.js @@ -0,0 +1,62 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START apigeeregistry_v1_generated_Registry_GetArtifactContents_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 artifact whose contents should be retrieved. + * Format: `{parent}/artifacts/*` + */ + // const name = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callGetArtifactContents() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await apigeeregistryClient.getArtifactContents(request); + console.log(response); + } + + callGetArtifactContents(); + // [END apigeeregistry_v1_generated_Registry_GetArtifactContents_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployment_revisions.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployment_revisions.js new file mode 100644 index 00000000000..21685cd096a --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployment_revisions.js @@ -0,0 +1,72 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START apigeeregistry_v1_generated_Registry_ListApiDeploymentRevisions_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 to list revisions for. + */ + // const name = 'abc123' + /** + * The maximum number of revisions to return per page. + */ + // const pageSize = 1234 + /** + * The page token, received from a previous ListApiDeploymentRevisions call. + * Provide this to retrieve the subsequent page. + */ + // const pageToken = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callListApiDeploymentRevisions() { + // Construct request + const request = { + name, + }; + + // Run request + const iterable = await apigeeregistryClient.listApiDeploymentRevisionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListApiDeploymentRevisions(); + // [END apigeeregistry_v1_generated_Registry_ListApiDeploymentRevisions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployments.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployments.js new file mode 100644 index 00000000000..6412a285fb9 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployments.js @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START apigeeregistry_v1_generated_Registry_ListApiDeployments_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 deployments. + * Format: `projects/* /locations/* /apis/*` + */ + // const parent = 'abc123' + /** + * The maximum number of deployments to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListApiDeployments` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListApiDeployments` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + */ + // const filter = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callListApiDeployments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await apigeeregistryClient.listApiDeploymentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListApiDeployments(); + // [END apigeeregistry_v1_generated_Registry_ListApiDeployments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_spec_revisions.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_spec_revisions.js new file mode 100644 index 00000000000..c6726ae8423 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_spec_revisions.js @@ -0,0 +1,72 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START apigeeregistry_v1_generated_Registry_ListApiSpecRevisions_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 list revisions for. + */ + // const name = 'abc123' + /** + * The maximum number of revisions to return per page. + */ + // const pageSize = 1234 + /** + * The page token, received from a previous ListApiSpecRevisions call. + * Provide this to retrieve the subsequent page. + */ + // const pageToken = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callListApiSpecRevisions() { + // Construct request + const request = { + name, + }; + + // Run request + const iterable = await apigeeregistryClient.listApiSpecRevisionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListApiSpecRevisions(); + // [END apigeeregistry_v1_generated_Registry_ListApiSpecRevisions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_specs.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_specs.js new file mode 100644 index 00000000000..396e72470f5 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_specs.js @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START apigeeregistry_v1_generated_Registry_ListApiSpecs_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/* /locations/* /apis/* /versions/*` + */ + // const parent = 'abc123' + /** + * The maximum number of specs to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListApiSpecs` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListApiSpecs` must match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields except contents. + */ + // const filter = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callListApiSpecs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await apigeeregistryClient.listApiSpecsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListApiSpecs(); + // [END apigeeregistry_v1_generated_Registry_ListApiSpecs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_versions.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_versions.js new file mode 100644 index 00000000000..2b077b508ae --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_versions.js @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START apigeeregistry_v1_generated_Registry_ListApiVersions_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 versions. + * Format: `projects/* /locations/* /apis/*` + */ + // const parent = 'abc123' + /** + * The maximum number of versions to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListApiVersions` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListApiVersions` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + */ + // const filter = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callListApiVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await apigeeregistryClient.listApiVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListApiVersions(); + // [END apigeeregistry_v1_generated_Registry_ListApiVersions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_apis.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_apis.js new file mode 100644 index 00000000000..ea225496745 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_apis.js @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START apigeeregistry_v1_generated_Registry_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 APIs. + * Format: `projects/* /locations/*` + */ + // const parent = 'abc123' + /** + * The maximum number of APIs to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListApis` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListApis` must match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + */ + // const filter = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callListApis() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await apigeeregistryClient.listApisAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListApis(); + // [END apigeeregistry_v1_generated_Registry_ListApis_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_artifacts.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_artifacts.js new file mode 100644 index 00000000000..ca9a2c07339 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_artifacts.js @@ -0,0 +1,83 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START apigeeregistry_v1_generated_Registry_ListArtifacts_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 artifacts. + * Format: `{parent}` + */ + // const parent = 'abc123' + /** + * The maximum number of artifacts to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListArtifacts` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListArtifacts` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields except contents. + */ + // const filter = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callListArtifacts() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await apigeeregistryClient.listArtifactsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListArtifacts(); + // [END apigeeregistry_v1_generated_Registry_ListArtifacts_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.replace_artifact.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.replace_artifact.js new file mode 100644 index 00000000000..91f3904ff6d --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.replace_artifact.js @@ -0,0 +1,63 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(artifact) { + // [START apigeeregistry_v1_generated_Registry_ReplaceArtifact_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 artifact to replace. + * The `name` field is used to identify the artifact to replace. + * Format: `{parent}/artifacts/*` + */ + // const artifact = {} + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callReplaceArtifact() { + // Construct request + const request = { + artifact, + }; + + // Run request + const response = await apigeeregistryClient.replaceArtifact(request); + console.log(response); + } + + callReplaceArtifact(); + // [END apigeeregistry_v1_generated_Registry_ReplaceArtifact_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_deployment.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_deployment.js new file mode 100644 index 00000000000..41317e3c670 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_deployment.js @@ -0,0 +1,68 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, revisionId) { + // [START apigeeregistry_v1_generated_Registry_RollbackApiDeployment_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 being rolled back. + */ + // const name = 'abc123' + /** + * Required. The revision ID to roll back to. + * It must be a revision of the same deployment. + * Example: `c7cfa2a8` + */ + // const revisionId = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callRollbackApiDeployment() { + // Construct request + const request = { + name, + revisionId, + }; + + // Run request + const response = await apigeeregistryClient.rollbackApiDeployment(request); + console.log(response); + } + + callRollbackApiDeployment(); + // [END apigeeregistry_v1_generated_Registry_RollbackApiDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_spec.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_spec.js new file mode 100644 index 00000000000..bc7a521df81 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_spec.js @@ -0,0 +1,68 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, revisionId) { + // [START apigeeregistry_v1_generated_Registry_RollbackApiSpec_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 being rolled back. + */ + // const name = 'abc123' + /** + * Required. The revision ID to roll back to. + * It must be a revision of the same spec. + * Example: `c7cfa2a8` + */ + // const revisionId = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callRollbackApiSpec() { + // Construct request + const request = { + name, + revisionId, + }; + + // Run request + const response = await apigeeregistryClient.rollbackApiSpec(request); + console.log(response); + } + + callRollbackApiSpec(); + // [END apigeeregistry_v1_generated_Registry_RollbackApiSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_deployment_revision.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_deployment_revision.js new file mode 100644 index 00000000000..29cb0bd9fb6 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_deployment_revision.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, tag) { + // [START apigeeregistry_v1_generated_Registry_TagApiDeploymentRevision_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 to be tagged, including the revision ID. + */ + // const name = 'abc123' + /** + * Required. The tag to apply. + * The tag should be at most 40 characters, and match `[a-z][a-z0-9-]{3,39}`. + */ + // const tag = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callTagApiDeploymentRevision() { + // Construct request + const request = { + name, + tag, + }; + + // Run request + const response = await apigeeregistryClient.tagApiDeploymentRevision(request); + console.log(response); + } + + callTagApiDeploymentRevision(); + // [END apigeeregistry_v1_generated_Registry_TagApiDeploymentRevision_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_spec_revision.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_spec_revision.js new file mode 100644 index 00000000000..e76171edb5f --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_spec_revision.js @@ -0,0 +1,67 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, tag) { + // [START apigeeregistry_v1_generated_Registry_TagApiSpecRevision_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 tagged, including the revision ID. + */ + // const name = 'abc123' + /** + * Required. The tag to apply. + * The tag should be at most 40 characters, and match `[a-z][a-z0-9-]{3,39}`. + */ + // const tag = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callTagApiSpecRevision() { + // Construct request + const request = { + name, + tag, + }; + + // Run request + const response = await apigeeregistryClient.tagApiSpecRevision(request); + console.log(response); + } + + callTagApiSpecRevision(); + // [END apigeeregistry_v1_generated_Registry_TagApiSpecRevision_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api.js new file mode 100644 index 00000000000..a4dd8524d30 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api.js @@ -0,0 +1,75 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(api) { + // [START apigeeregistry_v1_generated_Registry_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 to update. + * The `name` field is used to identify the API to update. + * Format: `projects/* /locations/* /apis/*` + */ + // const api = {} + /** + * The list of fields to be updated. If omitted, all fields are updated that + * are set in the request message (fields set to default values are ignored). + * If an asterisk "*" is specified, all fields are updated, including fields + * that are unspecified/default in the request. + */ + // const updateMask = {} + /** + * If set to true, and the API is not found, a new API will be created. + * In this situation, `update_mask` is ignored. + */ + // const allowMissing = true + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callUpdateApi() { + // Construct request + const request = { + api, + }; + + // Run request + const response = await apigeeregistryClient.updateApi(request); + console.log(response); + } + + callUpdateApi(); + // [END apigeeregistry_v1_generated_Registry_UpdateApi_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_deployment.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_deployment.js new file mode 100644 index 00000000000..90166532846 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_deployment.js @@ -0,0 +1,75 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(apiDeployment) { + // [START apigeeregistry_v1_generated_Registry_UpdateApiDeployment_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 to update. + * The `name` field is used to identify the deployment to update. + * Format: `projects/* /locations/* /apis/* /deployments/*` + */ + // const apiDeployment = {} + /** + * The list of fields to be updated. If omitted, all fields are updated that + * are set in the request message (fields set to default values are ignored). + * If an asterisk "*" is specified, all fields are updated, including fields + * that are unspecified/default in the request. + */ + // const updateMask = {} + /** + * If set to true, and the deployment is not found, a new deployment will be + * created. In this situation, `update_mask` is ignored. + */ + // const allowMissing = true + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callUpdateApiDeployment() { + // Construct request + const request = { + apiDeployment, + }; + + // Run request + const response = await apigeeregistryClient.updateApiDeployment(request); + console.log(response); + } + + callUpdateApiDeployment(); + // [END apigeeregistry_v1_generated_Registry_UpdateApiDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_spec.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_spec.js new file mode 100644 index 00000000000..a3f50379171 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_spec.js @@ -0,0 +1,75 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(apiSpec) { + // [START apigeeregistry_v1_generated_Registry_UpdateApiSpec_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 `name` field is used to identify the spec to update. + * Format: `projects/* /locations/* /apis/* /versions/* /specs/*` + */ + // const apiSpec = {} + /** + * The list of fields to be updated. If omitted, all fields are updated that + * are set in the request message (fields set to default values are ignored). + * If an asterisk "*" is specified, all fields are updated, including fields + * that are unspecified/default in the request. + */ + // const updateMask = {} + /** + * If set to true, and the spec is not found, a new spec will be created. + * In this situation, `update_mask` is ignored. + */ + // const allowMissing = true + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callUpdateApiSpec() { + // Construct request + const request = { + apiSpec, + }; + + // Run request + const response = await apigeeregistryClient.updateApiSpec(request); + console.log(response); + } + + callUpdateApiSpec(); + // [END apigeeregistry_v1_generated_Registry_UpdateApiSpec_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_version.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_version.js new file mode 100644 index 00000000000..38b633ed179 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_version.js @@ -0,0 +1,75 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(apiVersion) { + // [START apigeeregistry_v1_generated_Registry_UpdateApiVersion_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 version to update. + * The `name` field is used to identify the version to update. + * Format: `projects/* /locations/* /apis/* /versions/*` + */ + // const apiVersion = {} + /** + * The list of fields to be updated. If omitted, all fields are updated that + * are set in the request message (fields set to default values are ignored). + * If an asterisk "*" is specified, all fields are updated, including fields + * that are unspecified/default in the request. + */ + // const updateMask = {} + /** + * If set to true, and the version is not found, a new version will be + * created. In this situation, `update_mask` is ignored. + */ + // const allowMissing = true + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callUpdateApiVersion() { + // Construct request + const request = { + apiVersion, + }; + + // Run request + const response = await apigeeregistryClient.updateApiVersion(request); + console.log(response); + } + + callUpdateApiVersion(); + // [END apigeeregistry_v1_generated_Registry_UpdateApiVersion_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/snippet_metadata.google.cloud.apigeeregistry.v1.json b/packages/google-cloud-apigeeregistry/samples/generated/v1/snippet_metadata.google.cloud.apigeeregistry.v1.json new file mode 100644 index 00000000000..3451f7b1dec --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/snippet_metadata.google.cloud.apigeeregistry.v1.json @@ -0,0 +1,1723 @@ +{ + "clientLibrary": { + "name": "nodejs-apigeeregistry", + "version": "1.0.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.apigeeregistry.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "apigeeregistry_v1_generated_Provisioning_CreateInstance_async", + "title": "Provisioning createInstance Sample", + "origin": "API_DEFINITION", + "description": " Provisions instance resources for the Registry.", + "canonical": true, + "file": "provisioning.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.apigeeregistry.v1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProvisioningClient", + "fullName": "google.cloud.apigeeregistry.v1.ProvisioningClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.CreateInstance", + "service": { + "shortName": "Provisioning", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Provisioning_DeleteInstance_async", + "title": "Provisioning deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes the Registry instance.", + "canonical": true, + "file": "provisioning.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProvisioningClient", + "fullName": "google.cloud.apigeeregistry.v1.ProvisioningClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.DeleteInstance", + "service": { + "shortName": "Provisioning", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Provisioning_GetInstance_async", + "title": "Provisioning getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Instance.", + "canonical": true, + "file": "provisioning.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Instance", + "client": { + "shortName": "ProvisioningClient", + "fullName": "google.cloud.apigeeregistry.v1.ProvisioningClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.GetInstance", + "service": { + "shortName": "Provisioning", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApis_async", + "title": "Provisioning listApis Sample", + "origin": "API_DEFINITION", + "description": " Returns matching APIs.", + "canonical": true, + "file": "registry.list_apis.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApis", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApis", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApisResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApis", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApis", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetApi_async", + "title": "Provisioning getApi Sample", + "origin": "API_DEFINITION", + "description": " Returns a specified API.", + "canonical": true, + "file": "registry.get_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApi", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Api", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApi", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_CreateApi_async", + "title": "Provisioning createApi Sample", + "origin": "API_DEFINITION", + "description": " Creates a specified API.", + "canonical": true, + "file": "registry.create_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApi", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "api", + "type": ".google.cloud.apigeeregistry.v1.Api" + }, + { + "name": "api_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Api", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "CreateApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApi", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_UpdateApi_async", + "title": "Provisioning updateApi Sample", + "origin": "API_DEFINITION", + "description": " Used to modify a specified API.", + "canonical": true, + "file": "registry.update_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApi", + "async": true, + "parameters": [ + { + "name": "api", + "type": ".google.cloud.apigeeregistry.v1.Api" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Api", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "UpdateApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApi", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApi_async", + "title": "Provisioning deleteApi Sample", + "origin": "API_DEFINITION", + "description": " Removes a specified API and all of the resources that it owns.", + "canonical": true, + "file": "registry.delete_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApi", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApi", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApiVersions_async", + "title": "Provisioning listApiVersions Sample", + "origin": "API_DEFINITION", + "description": " Returns matching versions.", + "canonical": true, + "file": "registry.list_api_versions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiVersions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiVersions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApiVersionsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApiVersions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiVersions", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetApiVersion_async", + "title": "Provisioning getApiVersion Sample", + "origin": "API_DEFINITION", + "description": " Returns a specified version.", + "canonical": true, + "file": "registry.get_api_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiVersion", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiVersion", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_CreateApiVersion_async", + "title": "Provisioning createApiVersion Sample", + "origin": "API_DEFINITION", + "description": " Creates a specified version.", + "canonical": true, + "file": "registry.create_api_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiVersion", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "api_version", + "type": ".google.cloud.apigeeregistry.v1.ApiVersion" + }, + { + "name": "api_version_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiVersion", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "CreateApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiVersion", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_UpdateApiVersion_async", + "title": "Provisioning updateApiVersion Sample", + "origin": "API_DEFINITION", + "description": " Used to modify a specified version.", + "canonical": true, + "file": "registry.update_api_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiVersion", + "async": true, + "parameters": [ + { + "name": "api_version", + "type": ".google.cloud.apigeeregistry.v1.ApiVersion" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiVersion", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "UpdateApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiVersion", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiVersion_async", + "title": "Provisioning deleteApiVersion Sample", + "origin": "API_DEFINITION", + "description": " Removes a specified version and all of the resources that it owns.", + "canonical": true, + "file": "registry.delete_api_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiVersion", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApiSpecs_async", + "title": "Provisioning listApiSpecs Sample", + "origin": "API_DEFINITION", + "description": " Returns matching specs.", + "canonical": true, + "file": "registry.list_api_specs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiSpecs", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiSpecs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApiSpecsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApiSpecs", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiSpecs", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetApiSpec_async", + "title": "Provisioning getApiSpec Sample", + "origin": "API_DEFINITION", + "description": " Returns a specified spec.", + "canonical": true, + "file": "registry.get_api_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiSpec", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetApiSpecContents_async", + "title": "Provisioning getApiSpecContents Sample", + "origin": "API_DEFINITION", + "description": " Returns the contents of a specified spec. If specs are stored with GZip compression, the default behavior is to return the spec uncompressed (the mime_type response field indicates the exact format returned).", + "canonical": true, + "file": "registry.get_api_spec_contents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApiSpecContents", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiSpecContents", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.api.HttpBody", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetApiSpecContents", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiSpecContents", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_CreateApiSpec_async", + "title": "Provisioning createApiSpec Sample", + "origin": "API_DEFINITION", + "description": " Creates a specified spec.", + "canonical": true, + "file": "registry.create_api_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiSpec", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "api_spec", + "type": ".google.cloud.apigeeregistry.v1.ApiSpec" + }, + { + "name": "api_spec_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "CreateApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiSpec", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_UpdateApiSpec_async", + "title": "Provisioning updateApiSpec Sample", + "origin": "API_DEFINITION", + "description": " Used to modify a specified spec.", + "canonical": true, + "file": "registry.update_api_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiSpec", + "async": true, + "parameters": [ + { + "name": "api_spec", + "type": ".google.cloud.apigeeregistry.v1.ApiSpec" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "UpdateApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiSpec", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiSpec_async", + "title": "Provisioning deleteApiSpec Sample", + "origin": "API_DEFINITION", + "description": " Removes a specified spec, all revisions, and all child resources (e.g., artifacts).", + "canonical": true, + "file": "registry.delete_api_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiSpec", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_TagApiSpecRevision_async", + "title": "Provisioning tagApiSpecRevision Sample", + "origin": "API_DEFINITION", + "description": " Adds a tag to a specified revision of a spec.", + "canonical": true, + "file": "registry.tag_api_spec_revision.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TagApiSpecRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.TagApiSpecRevision", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "tag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "TagApiSpecRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.TagApiSpecRevision", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApiSpecRevisions_async", + "title": "Provisioning listApiSpecRevisions Sample", + "origin": "API_DEFINITION", + "description": " Lists all revisions of a spec. Revisions are returned in descending order of revision creation time.", + "canonical": true, + "file": "registry.list_api_spec_revisions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiSpecRevisions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiSpecRevisions", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApiSpecRevisions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiSpecRevisions", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_RollbackApiSpec_async", + "title": "Provisioning rollbackApiSpec Sample", + "origin": "API_DEFINITION", + "description": " Sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID.", + "canonical": true, + "file": "registry.rollback_api_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RollbackApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.RollbackApiSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "revision_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "RollbackApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.RollbackApiSpec", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiSpecRevision_async", + "title": "Provisioning deleteApiSpecRevision Sample", + "origin": "API_DEFINITION", + "description": " Deletes a revision of a spec.", + "canonical": true, + "file": "registry.delete_api_spec_revision.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApiSpecRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiSpecRevision", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApiSpecRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiSpecRevision", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApiDeployments_async", + "title": "Provisioning listApiDeployments Sample", + "origin": "API_DEFINITION", + "description": " Returns matching deployments.", + "canonical": true, + "file": "registry.list_api_deployments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiDeployments", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiDeployments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApiDeployments", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiDeployments", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetApiDeployment_async", + "title": "Provisioning getApiDeployment Sample", + "origin": "API_DEFINITION", + "description": " Returns a specified deployment.", + "canonical": true, + "file": "registry.get_api_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiDeployment", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_CreateApiDeployment_async", + "title": "Provisioning createApiDeployment Sample", + "origin": "API_DEFINITION", + "description": " Creates a specified deployment.", + "canonical": true, + "file": "registry.create_api_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiDeployment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "api_deployment", + "type": ".google.cloud.apigeeregistry.v1.ApiDeployment" + }, + { + "name": "api_deployment_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "CreateApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiDeployment", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_UpdateApiDeployment_async", + "title": "Provisioning updateApiDeployment Sample", + "origin": "API_DEFINITION", + "description": " Used to modify a specified deployment.", + "canonical": true, + "file": "registry.update_api_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiDeployment", + "async": true, + "parameters": [ + { + "name": "api_deployment", + "type": ".google.cloud.apigeeregistry.v1.ApiDeployment" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "UpdateApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiDeployment", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiDeployment_async", + "title": "Provisioning deleteApiDeployment Sample", + "origin": "API_DEFINITION", + "description": " Removes a specified deployment, all revisions, and all child resources (e.g., artifacts).", + "canonical": true, + "file": "registry.delete_api_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiDeployment", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_TagApiDeploymentRevision_async", + "title": "Provisioning tagApiDeploymentRevision Sample", + "origin": "API_DEFINITION", + "description": " Adds a tag to a specified revision of a deployment.", + "canonical": true, + "file": "registry.tag_api_deployment_revision.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TagApiDeploymentRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.TagApiDeploymentRevision", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "tag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "TagApiDeploymentRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.TagApiDeploymentRevision", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApiDeploymentRevisions_async", + "title": "Provisioning listApiDeploymentRevisions Sample", + "origin": "API_DEFINITION", + "description": " Lists all revisions of a deployment. Revisions are returned in descending order of revision creation time.", + "canonical": true, + "file": "registry.list_api_deployment_revisions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiDeploymentRevisions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiDeploymentRevisions", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApiDeploymentRevisions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiDeploymentRevisions", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_RollbackApiDeployment_async", + "title": "Provisioning rollbackApiDeployment Sample", + "origin": "API_DEFINITION", + "description": " Sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID.", + "canonical": true, + "file": "registry.rollback_api_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RollbackApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.RollbackApiDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "revision_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "RollbackApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.RollbackApiDeployment", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiDeploymentRevision_async", + "title": "Provisioning deleteApiDeploymentRevision Sample", + "origin": "API_DEFINITION", + "description": " Deletes a revision of a deployment.", + "canonical": true, + "file": "registry.delete_api_deployment_revision.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApiDeploymentRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiDeploymentRevision", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApiDeploymentRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiDeploymentRevision", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListArtifacts_async", + "title": "Provisioning listArtifacts Sample", + "origin": "API_DEFINITION", + "description": " Returns matching artifacts.", + "canonical": true, + "file": "registry.list_artifacts.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListArtifacts", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListArtifacts", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListArtifactsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListArtifacts", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListArtifacts", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetArtifact_async", + "title": "Provisioning getArtifact Sample", + "origin": "API_DEFINITION", + "description": " Returns a specified artifact.", + "canonical": true, + "file": "registry.get_artifact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetArtifact", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Artifact", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetArtifact", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetArtifactContents_async", + "title": "Provisioning getArtifactContents Sample", + "origin": "API_DEFINITION", + "description": " Returns the contents of a specified artifact. If artifacts are stored with GZip compression, the default behavior is to return the artifact uncompressed (the mime_type response field indicates the exact format returned).", + "canonical": true, + "file": "registry.get_artifact_contents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetArtifactContents", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetArtifactContents", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.api.HttpBody", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetArtifactContents", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetArtifactContents", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_CreateArtifact_async", + "title": "Provisioning createArtifact Sample", + "origin": "API_DEFINITION", + "description": " Creates a specified artifact.", + "canonical": true, + "file": "registry.create_artifact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateArtifact", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "artifact", + "type": ".google.cloud.apigeeregistry.v1.Artifact" + }, + { + "name": "artifact_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Artifact", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "CreateArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateArtifact", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ReplaceArtifact_async", + "title": "Provisioning replaceArtifact Sample", + "origin": "API_DEFINITION", + "description": " Used to replace a specified artifact.", + "canonical": true, + "file": "registry.replace_artifact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ReplaceArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ReplaceArtifact", + "async": true, + "parameters": [ + { + "name": "artifact", + "type": ".google.cloud.apigeeregistry.v1.Artifact" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Artifact", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ReplaceArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ReplaceArtifact", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteArtifact_async", + "title": "Provisioning deleteArtifact Sample", + "origin": "API_DEFINITION", + "description": " Removes a specified artifact.", + "canonical": true, + "file": "registry.delete_artifact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteArtifact", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteArtifact", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/snippet_metadata_google.cloud.apigeeregistry.v1.json b/packages/google-cloud-apigeeregistry/samples/generated/v1/snippet_metadata_google.cloud.apigeeregistry.v1.json new file mode 100644 index 00000000000..3451f7b1dec --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/snippet_metadata_google.cloud.apigeeregistry.v1.json @@ -0,0 +1,1723 @@ +{ + "clientLibrary": { + "name": "nodejs-apigeeregistry", + "version": "1.0.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.apigeeregistry.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "apigeeregistry_v1_generated_Provisioning_CreateInstance_async", + "title": "Provisioning createInstance Sample", + "origin": "API_DEFINITION", + "description": " Provisions instance resources for the Registry.", + "canonical": true, + "file": "provisioning.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.apigeeregistry.v1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProvisioningClient", + "fullName": "google.cloud.apigeeregistry.v1.ProvisioningClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.CreateInstance", + "service": { + "shortName": "Provisioning", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Provisioning_DeleteInstance_async", + "title": "Provisioning deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes the Registry instance.", + "canonical": true, + "file": "provisioning.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ProvisioningClient", + "fullName": "google.cloud.apigeeregistry.v1.ProvisioningClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.DeleteInstance", + "service": { + "shortName": "Provisioning", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Provisioning_GetInstance_async", + "title": "Provisioning getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Instance.", + "canonical": true, + "file": "provisioning.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Instance", + "client": { + "shortName": "ProvisioningClient", + "fullName": "google.cloud.apigeeregistry.v1.ProvisioningClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning.GetInstance", + "service": { + "shortName": "Provisioning", + "fullName": "google.cloud.apigeeregistry.v1.Provisioning" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApis_async", + "title": "Provisioning listApis Sample", + "origin": "API_DEFINITION", + "description": " Returns matching APIs.", + "canonical": true, + "file": "registry.list_apis.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApis", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApis", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApisResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApis", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApis", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetApi_async", + "title": "Provisioning getApi Sample", + "origin": "API_DEFINITION", + "description": " Returns a specified API.", + "canonical": true, + "file": "registry.get_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApi", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Api", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApi", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_CreateApi_async", + "title": "Provisioning createApi Sample", + "origin": "API_DEFINITION", + "description": " Creates a specified API.", + "canonical": true, + "file": "registry.create_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApi", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "api", + "type": ".google.cloud.apigeeregistry.v1.Api" + }, + { + "name": "api_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Api", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "CreateApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApi", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_UpdateApi_async", + "title": "Provisioning updateApi Sample", + "origin": "API_DEFINITION", + "description": " Used to modify a specified API.", + "canonical": true, + "file": "registry.update_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApi", + "async": true, + "parameters": [ + { + "name": "api", + "type": ".google.cloud.apigeeregistry.v1.Api" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Api", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "UpdateApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApi", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApi_async", + "title": "Provisioning deleteApi Sample", + "origin": "API_DEFINITION", + "description": " Removes a specified API and all of the resources that it owns.", + "canonical": true, + "file": "registry.delete_api.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApi", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApi", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApi", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApiVersions_async", + "title": "Provisioning listApiVersions Sample", + "origin": "API_DEFINITION", + "description": " Returns matching versions.", + "canonical": true, + "file": "registry.list_api_versions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiVersions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiVersions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApiVersionsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApiVersions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiVersions", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetApiVersion_async", + "title": "Provisioning getApiVersion Sample", + "origin": "API_DEFINITION", + "description": " Returns a specified version.", + "canonical": true, + "file": "registry.get_api_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiVersion", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiVersion", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_CreateApiVersion_async", + "title": "Provisioning createApiVersion Sample", + "origin": "API_DEFINITION", + "description": " Creates a specified version.", + "canonical": true, + "file": "registry.create_api_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiVersion", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "api_version", + "type": ".google.cloud.apigeeregistry.v1.ApiVersion" + }, + { + "name": "api_version_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiVersion", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "CreateApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiVersion", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_UpdateApiVersion_async", + "title": "Provisioning updateApiVersion Sample", + "origin": "API_DEFINITION", + "description": " Used to modify a specified version.", + "canonical": true, + "file": "registry.update_api_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiVersion", + "async": true, + "parameters": [ + { + "name": "api_version", + "type": ".google.cloud.apigeeregistry.v1.ApiVersion" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiVersion", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "UpdateApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiVersion", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiVersion_async", + "title": "Provisioning deleteApiVersion Sample", + "origin": "API_DEFINITION", + "description": " Removes a specified version and all of the resources that it owns.", + "canonical": true, + "file": "registry.delete_api_version.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiVersion", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApiVersion", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiVersion", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApiSpecs_async", + "title": "Provisioning listApiSpecs Sample", + "origin": "API_DEFINITION", + "description": " Returns matching specs.", + "canonical": true, + "file": "registry.list_api_specs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiSpecs", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiSpecs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApiSpecsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApiSpecs", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiSpecs", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetApiSpec_async", + "title": "Provisioning getApiSpec Sample", + "origin": "API_DEFINITION", + "description": " Returns a specified spec.", + "canonical": true, + "file": "registry.get_api_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiSpec", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetApiSpecContents_async", + "title": "Provisioning getApiSpecContents Sample", + "origin": "API_DEFINITION", + "description": " Returns the contents of a specified spec. If specs are stored with GZip compression, the default behavior is to return the spec uncompressed (the mime_type response field indicates the exact format returned).", + "canonical": true, + "file": "registry.get_api_spec_contents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApiSpecContents", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiSpecContents", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.api.HttpBody", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetApiSpecContents", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiSpecContents", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_CreateApiSpec_async", + "title": "Provisioning createApiSpec Sample", + "origin": "API_DEFINITION", + "description": " Creates a specified spec.", + "canonical": true, + "file": "registry.create_api_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiSpec", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "api_spec", + "type": ".google.cloud.apigeeregistry.v1.ApiSpec" + }, + { + "name": "api_spec_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "CreateApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiSpec", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_UpdateApiSpec_async", + "title": "Provisioning updateApiSpec Sample", + "origin": "API_DEFINITION", + "description": " Used to modify a specified spec.", + "canonical": true, + "file": "registry.update_api_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiSpec", + "async": true, + "parameters": [ + { + "name": "api_spec", + "type": ".google.cloud.apigeeregistry.v1.ApiSpec" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "UpdateApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiSpec", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiSpec_async", + "title": "Provisioning deleteApiSpec Sample", + "origin": "API_DEFINITION", + "description": " Removes a specified spec, all revisions, and all child resources (e.g., artifacts).", + "canonical": true, + "file": "registry.delete_api_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiSpec", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_TagApiSpecRevision_async", + "title": "Provisioning tagApiSpecRevision Sample", + "origin": "API_DEFINITION", + "description": " Adds a tag to a specified revision of a spec.", + "canonical": true, + "file": "registry.tag_api_spec_revision.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TagApiSpecRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.TagApiSpecRevision", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "tag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "TagApiSpecRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.TagApiSpecRevision", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApiSpecRevisions_async", + "title": "Provisioning listApiSpecRevisions Sample", + "origin": "API_DEFINITION", + "description": " Lists all revisions of a spec. Revisions are returned in descending order of revision creation time.", + "canonical": true, + "file": "registry.list_api_spec_revisions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiSpecRevisions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiSpecRevisions", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApiSpecRevisionsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApiSpecRevisions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiSpecRevisions", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_RollbackApiSpec_async", + "title": "Provisioning rollbackApiSpec Sample", + "origin": "API_DEFINITION", + "description": " Sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID.", + "canonical": true, + "file": "registry.rollback_api_spec.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RollbackApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.RollbackApiSpec", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "revision_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "RollbackApiSpec", + "fullName": "google.cloud.apigeeregistry.v1.Registry.RollbackApiSpec", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiSpecRevision_async", + "title": "Provisioning deleteApiSpecRevision Sample", + "origin": "API_DEFINITION", + "description": " Deletes a revision of a spec.", + "canonical": true, + "file": "registry.delete_api_spec_revision.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApiSpecRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiSpecRevision", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiSpec", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApiSpecRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiSpecRevision", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApiDeployments_async", + "title": "Provisioning listApiDeployments Sample", + "origin": "API_DEFINITION", + "description": " Returns matching deployments.", + "canonical": true, + "file": "registry.list_api_deployments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiDeployments", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiDeployments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApiDeploymentsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApiDeployments", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiDeployments", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetApiDeployment_async", + "title": "Provisioning getApiDeployment Sample", + "origin": "API_DEFINITION", + "description": " Returns a specified deployment.", + "canonical": true, + "file": "registry.get_api_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetApiDeployment", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_CreateApiDeployment_async", + "title": "Provisioning createApiDeployment Sample", + "origin": "API_DEFINITION", + "description": " Creates a specified deployment.", + "canonical": true, + "file": "registry.create_api_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiDeployment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "api_deployment", + "type": ".google.cloud.apigeeregistry.v1.ApiDeployment" + }, + { + "name": "api_deployment_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "CreateApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateApiDeployment", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_UpdateApiDeployment_async", + "title": "Provisioning updateApiDeployment Sample", + "origin": "API_DEFINITION", + "description": " Used to modify a specified deployment.", + "canonical": true, + "file": "registry.update_api_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiDeployment", + "async": true, + "parameters": [ + { + "name": "api_deployment", + "type": ".google.cloud.apigeeregistry.v1.ApiDeployment" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "UpdateApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.UpdateApiDeployment", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiDeployment_async", + "title": "Provisioning deleteApiDeployment Sample", + "origin": "API_DEFINITION", + "description": " Removes a specified deployment, all revisions, and all child resources (e.g., artifacts).", + "canonical": true, + "file": "registry.delete_api_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiDeployment", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_TagApiDeploymentRevision_async", + "title": "Provisioning tagApiDeploymentRevision Sample", + "origin": "API_DEFINITION", + "description": " Adds a tag to a specified revision of a deployment.", + "canonical": true, + "file": "registry.tag_api_deployment_revision.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TagApiDeploymentRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.TagApiDeploymentRevision", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "tag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "TagApiDeploymentRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.TagApiDeploymentRevision", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListApiDeploymentRevisions_async", + "title": "Provisioning listApiDeploymentRevisions Sample", + "origin": "API_DEFINITION", + "description": " Lists all revisions of a deployment. Revisions are returned in descending order of revision creation time.", + "canonical": true, + "file": "registry.list_api_deployment_revisions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListApiDeploymentRevisions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiDeploymentRevisions", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListApiDeploymentRevisions", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListApiDeploymentRevisions", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_RollbackApiDeployment_async", + "title": "Provisioning rollbackApiDeployment Sample", + "origin": "API_DEFINITION", + "description": " Sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID.", + "canonical": true, + "file": "registry.rollback_api_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RollbackApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.RollbackApiDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "revision_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "RollbackApiDeployment", + "fullName": "google.cloud.apigeeregistry.v1.Registry.RollbackApiDeployment", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteApiDeploymentRevision_async", + "title": "Provisioning deleteApiDeploymentRevision Sample", + "origin": "API_DEFINITION", + "description": " Deletes a revision of a deployment.", + "canonical": true, + "file": "registry.delete_api_deployment_revision.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteApiDeploymentRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiDeploymentRevision", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ApiDeployment", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteApiDeploymentRevision", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteApiDeploymentRevision", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ListArtifacts_async", + "title": "Provisioning listArtifacts Sample", + "origin": "API_DEFINITION", + "description": " Returns matching artifacts.", + "canonical": true, + "file": "registry.list_artifacts.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListArtifacts", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListArtifacts", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.ListArtifactsResponse", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ListArtifacts", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ListArtifacts", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetArtifact_async", + "title": "Provisioning getArtifact Sample", + "origin": "API_DEFINITION", + "description": " Returns a specified artifact.", + "canonical": true, + "file": "registry.get_artifact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetArtifact", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Artifact", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetArtifact", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_GetArtifactContents_async", + "title": "Provisioning getArtifactContents Sample", + "origin": "API_DEFINITION", + "description": " Returns the contents of a specified artifact. If artifacts are stored with GZip compression, the default behavior is to return the artifact uncompressed (the mime_type response field indicates the exact format returned).", + "canonical": true, + "file": "registry.get_artifact_contents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetArtifactContents", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetArtifactContents", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.api.HttpBody", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "GetArtifactContents", + "fullName": "google.cloud.apigeeregistry.v1.Registry.GetArtifactContents", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_CreateArtifact_async", + "title": "Provisioning createArtifact Sample", + "origin": "API_DEFINITION", + "description": " Creates a specified artifact.", + "canonical": true, + "file": "registry.create_artifact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateArtifact", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "artifact", + "type": ".google.cloud.apigeeregistry.v1.Artifact" + }, + { + "name": "artifact_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Artifact", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "CreateArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.CreateArtifact", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_ReplaceArtifact_async", + "title": "Provisioning replaceArtifact Sample", + "origin": "API_DEFINITION", + "description": " Used to replace a specified artifact.", + "canonical": true, + "file": "registry.replace_artifact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ReplaceArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ReplaceArtifact", + "async": true, + "parameters": [ + { + "name": "artifact", + "type": ".google.cloud.apigeeregistry.v1.Artifact" + } + ], + "resultType": ".google.cloud.apigeeregistry.v1.Artifact", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "ReplaceArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.ReplaceArtifact", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + }, + { + "regionTag": "apigeeregistry_v1_generated_Registry_DeleteArtifact_async", + "title": "Provisioning deleteArtifact Sample", + "origin": "API_DEFINITION", + "description": " Removes a specified artifact.", + "canonical": true, + "file": "registry.delete_artifact.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteArtifact", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RegistryClient", + "fullName": "google.cloud.apigeeregistry.v1.RegistryClient" + }, + "method": { + "shortName": "DeleteArtifact", + "fullName": "google.cloud.apigeeregistry.v1.Registry.DeleteArtifact", + "service": { + "shortName": "Registry", + "fullName": "google.cloud.apigeeregistry.v1.Registry" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-apigeeregistry/samples/package.json b/packages/google-cloud-apigeeregistry/samples/package.json new file mode 100644 index 00000000000..ef33dd9b337 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-apigee-registry", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=14.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/apigee-registry": "^1.0.1" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^10.0.0" + } +} \ No newline at end of file diff --git a/packages/google-cloud-apigeeregistry/samples/quickstart.js b/packages/google-cloud-apigeeregistry/samples/quickstart.js new file mode 100644 index 00000000000..9a0be9c5434 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/quickstart.js @@ -0,0 +1,78 @@ +// 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. +// +// ** 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 apigeeregistry_v1_generated_Registry_ListApis_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of APIs. + * Format: projects/* /locations/* + */ + // const parent = 'abc123' + /** + * The maximum number of APIs to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListApis` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListApis` must match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + */ + // const filter = 'abc123' + + // Imports the Apigeeregistry library + const {RegistryClient} = require('@google-cloud/apigee-registry').v1; + + // Instantiates a client + const apigeeregistryClient = new RegistryClient(); + + async function callListApis() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await apigeeregistryClient.listApisAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListApis(); + // [END apigeeregistry_v1_generated_Registry_ListApis_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-apigeeregistry/samples/test/quickstart.js b/packages/google-cloud-apigeeregistry/samples/test/quickstart.js new file mode 100644 index 00000000000..4603baafd9e --- /dev/null +++ b/packages/google-cloud-apigeeregistry/samples/test/quickstart.js @@ -0,0 +1,51 @@ +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +const path = require('path'); +const cp = require('child_process'); +const {before, describe, it} = require('mocha'); +// eslint-disable-next-line node/no-missing-require +const {RegistryClient} = require('@google-cloud/apigee-registry'); +// eslint-disable-next-line no-unused-vars, node/no-missing-require +const {assert} = require('chai'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +const client = new RegistryClient(); + +describe('Quickstart', () => { + //TODO: remove this if not using the projectId + // eslint-disable-next-line no-unused-vars + let projectId; + + before(async () => { + // eslint-disable-next-line no-unused-vars + projectId = await client.getProjectId(); + }); + + it('should run quickstart', async () => { + assert.throws(() => { + execSync(`node ./quickstart.js projects/${projectId}/locations/global`, { + cwd, + }); + }, /9 FAILED_PRECONDITION/); + }); +}); diff --git a/packages/google-cloud-apigeeregistry/src/index.ts b/packages/google-cloud-apigeeregistry/src/index.ts new file mode 100644 index 00000000000..2d705994a3a --- /dev/null +++ b/packages/google-cloud-apigeeregistry/src/index.ts @@ -0,0 +1,29 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const ProvisioningClient = v1.ProvisioningClient; +type ProvisioningClient = v1.ProvisioningClient; +const RegistryClient = v1.RegistryClient; +type RegistryClient = v1.RegistryClient; + +export {v1, ProvisioningClient, RegistryClient}; +export default {v1, ProvisioningClient, RegistryClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-apigeeregistry/src/v1/gapic_metadata.json b/packages/google-cloud-apigeeregistry/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..783049f935e --- /dev/null +++ b/packages/google-cloud-apigeeregistry/src/v1/gapic_metadata.json @@ -0,0 +1,445 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.apigeeregistry.v1", + "libraryPackage": "@google-cloud/apigee-registry", + "services": { + "Provisioning": { + "clients": { + "grpc": { + "libraryClient": "ProvisioningClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ProvisioningClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + } + } + } + } + }, + "Registry": { + "clients": { + "grpc": { + "libraryClient": "RegistryClient", + "rpcs": { + "GetApi": { + "methods": [ + "getApi" + ] + }, + "CreateApi": { + "methods": [ + "createApi" + ] + }, + "UpdateApi": { + "methods": [ + "updateApi" + ] + }, + "DeleteApi": { + "methods": [ + "deleteApi" + ] + }, + "GetApiVersion": { + "methods": [ + "getApiVersion" + ] + }, + "CreateApiVersion": { + "methods": [ + "createApiVersion" + ] + }, + "UpdateApiVersion": { + "methods": [ + "updateApiVersion" + ] + }, + "DeleteApiVersion": { + "methods": [ + "deleteApiVersion" + ] + }, + "GetApiSpec": { + "methods": [ + "getApiSpec" + ] + }, + "GetApiSpecContents": { + "methods": [ + "getApiSpecContents" + ] + }, + "CreateApiSpec": { + "methods": [ + "createApiSpec" + ] + }, + "UpdateApiSpec": { + "methods": [ + "updateApiSpec" + ] + }, + "DeleteApiSpec": { + "methods": [ + "deleteApiSpec" + ] + }, + "TagApiSpecRevision": { + "methods": [ + "tagApiSpecRevision" + ] + }, + "RollbackApiSpec": { + "methods": [ + "rollbackApiSpec" + ] + }, + "DeleteApiSpecRevision": { + "methods": [ + "deleteApiSpecRevision" + ] + }, + "GetApiDeployment": { + "methods": [ + "getApiDeployment" + ] + }, + "CreateApiDeployment": { + "methods": [ + "createApiDeployment" + ] + }, + "UpdateApiDeployment": { + "methods": [ + "updateApiDeployment" + ] + }, + "DeleteApiDeployment": { + "methods": [ + "deleteApiDeployment" + ] + }, + "TagApiDeploymentRevision": { + "methods": [ + "tagApiDeploymentRevision" + ] + }, + "RollbackApiDeployment": { + "methods": [ + "rollbackApiDeployment" + ] + }, + "DeleteApiDeploymentRevision": { + "methods": [ + "deleteApiDeploymentRevision" + ] + }, + "GetArtifact": { + "methods": [ + "getArtifact" + ] + }, + "GetArtifactContents": { + "methods": [ + "getArtifactContents" + ] + }, + "CreateArtifact": { + "methods": [ + "createArtifact" + ] + }, + "ReplaceArtifact": { + "methods": [ + "replaceArtifact" + ] + }, + "DeleteArtifact": { + "methods": [ + "deleteArtifact" + ] + }, + "ListApis": { + "methods": [ + "listApis", + "listApisStream", + "listApisAsync" + ] + }, + "ListApiVersions": { + "methods": [ + "listApiVersions", + "listApiVersionsStream", + "listApiVersionsAsync" + ] + }, + "ListApiSpecs": { + "methods": [ + "listApiSpecs", + "listApiSpecsStream", + "listApiSpecsAsync" + ] + }, + "ListApiSpecRevisions": { + "methods": [ + "listApiSpecRevisions", + "listApiSpecRevisionsStream", + "listApiSpecRevisionsAsync" + ] + }, + "ListApiDeployments": { + "methods": [ + "listApiDeployments", + "listApiDeploymentsStream", + "listApiDeploymentsAsync" + ] + }, + "ListApiDeploymentRevisions": { + "methods": [ + "listApiDeploymentRevisions", + "listApiDeploymentRevisionsStream", + "listApiDeploymentRevisionsAsync" + ] + }, + "ListArtifacts": { + "methods": [ + "listArtifacts", + "listArtifactsStream", + "listArtifactsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RegistryClient", + "rpcs": { + "GetApi": { + "methods": [ + "getApi" + ] + }, + "CreateApi": { + "methods": [ + "createApi" + ] + }, + "UpdateApi": { + "methods": [ + "updateApi" + ] + }, + "DeleteApi": { + "methods": [ + "deleteApi" + ] + }, + "GetApiVersion": { + "methods": [ + "getApiVersion" + ] + }, + "CreateApiVersion": { + "methods": [ + "createApiVersion" + ] + }, + "UpdateApiVersion": { + "methods": [ + "updateApiVersion" + ] + }, + "DeleteApiVersion": { + "methods": [ + "deleteApiVersion" + ] + }, + "GetApiSpec": { + "methods": [ + "getApiSpec" + ] + }, + "GetApiSpecContents": { + "methods": [ + "getApiSpecContents" + ] + }, + "CreateApiSpec": { + "methods": [ + "createApiSpec" + ] + }, + "UpdateApiSpec": { + "methods": [ + "updateApiSpec" + ] + }, + "DeleteApiSpec": { + "methods": [ + "deleteApiSpec" + ] + }, + "TagApiSpecRevision": { + "methods": [ + "tagApiSpecRevision" + ] + }, + "RollbackApiSpec": { + "methods": [ + "rollbackApiSpec" + ] + }, + "DeleteApiSpecRevision": { + "methods": [ + "deleteApiSpecRevision" + ] + }, + "GetApiDeployment": { + "methods": [ + "getApiDeployment" + ] + }, + "CreateApiDeployment": { + "methods": [ + "createApiDeployment" + ] + }, + "UpdateApiDeployment": { + "methods": [ + "updateApiDeployment" + ] + }, + "DeleteApiDeployment": { + "methods": [ + "deleteApiDeployment" + ] + }, + "TagApiDeploymentRevision": { + "methods": [ + "tagApiDeploymentRevision" + ] + }, + "RollbackApiDeployment": { + "methods": [ + "rollbackApiDeployment" + ] + }, + "DeleteApiDeploymentRevision": { + "methods": [ + "deleteApiDeploymentRevision" + ] + }, + "GetArtifact": { + "methods": [ + "getArtifact" + ] + }, + "GetArtifactContents": { + "methods": [ + "getArtifactContents" + ] + }, + "CreateArtifact": { + "methods": [ + "createArtifact" + ] + }, + "ReplaceArtifact": { + "methods": [ + "replaceArtifact" + ] + }, + "DeleteArtifact": { + "methods": [ + "deleteArtifact" + ] + }, + "ListApis": { + "methods": [ + "listApis", + "listApisStream", + "listApisAsync" + ] + }, + "ListApiVersions": { + "methods": [ + "listApiVersions", + "listApiVersionsStream", + "listApiVersionsAsync" + ] + }, + "ListApiSpecs": { + "methods": [ + "listApiSpecs", + "listApiSpecsStream", + "listApiSpecsAsync" + ] + }, + "ListApiSpecRevisions": { + "methods": [ + "listApiSpecRevisions", + "listApiSpecRevisionsStream", + "listApiSpecRevisionsAsync" + ] + }, + "ListApiDeployments": { + "methods": [ + "listApiDeployments", + "listApiDeploymentsStream", + "listApiDeploymentsAsync" + ] + }, + "ListApiDeploymentRevisions": { + "methods": [ + "listApiDeploymentRevisions", + "listApiDeploymentRevisionsStream", + "listApiDeploymentRevisionsAsync" + ] + }, + "ListArtifacts": { + "methods": [ + "listArtifacts", + "listArtifactsStream", + "listArtifactsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-apigeeregistry/src/v1/index.ts b/packages/google-cloud-apigeeregistry/src/v1/index.ts new file mode 100644 index 00000000000..6032a7e3443 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/src/v1/index.ts @@ -0,0 +1,20 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {ProvisioningClient} from './provisioning_client'; +export {RegistryClient} from './registry_client'; diff --git a/packages/google-cloud-apigeeregistry/src/v1/provisioning_client.ts b/packages/google-cloud-apigeeregistry/src/v1/provisioning_client.ts new file mode 100644 index 00000000000..c04c0a76b41 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/src/v1/provisioning_client.ts @@ -0,0 +1,2166 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + IamClient, + IamProtos, + 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; + +/** + * The service that is used for managing the data plane provisioning of the + * Registry. + * @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}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + 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; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + apiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}' + ), + apiDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}' + ), + apiSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' + ), + apiVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectLocationApiArtifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/artifacts/{artifact}' + ), + projectLocationApiDeploymentArtifactPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}/artifacts/{artifact}' + ), + projectLocationApiVersionArtifactPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/artifacts/{artifact}' + ), + projectLocationApiVersionSpecArtifactPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}/artifacts/{artifact}' + ), + projectLocationArtifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/artifacts/{artifact}' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1/{resource=projects/*/locations/*/apis/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1/{resource=projects/*/locations/*/apis/*/deployments/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/apis/*/versions/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/specs/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/artifacts/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/apis/*/artifacts/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/artifacts/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/instances/*}:getIamPolicy', + }, + {get: '/v1/{resource=projects/*/locations/*/runtime}:getIamPolicy'}, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/apis/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/apis/*/deployments/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/specs/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/artifacts/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/apis/*/artifacts/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/artifacts/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/instances/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/runtime}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/apis/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/apis/*/deployments/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/specs/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/artifacts/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/apis/*/artifacts/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/artifacts/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/apis/*/versions/*/specs/*/artifacts/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/instances/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/runtime}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.apigeeregistry.v1.Instance' + ) as gax.protobuf.Type; + const createInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.apigeeregistry.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteInstanceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.apigeeregistry.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInstanceResponse.decode.bind(createInstanceResponse), + createInstanceMetadata.decode.bind(createInstanceMetadata) + ), + deleteInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInstanceResponse.decode.bind(deleteInstanceResponse), + deleteInstanceMetadata.decode.bind(deleteInstanceMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.apigeeregistry.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.apigeeregistry.v1.Provisioning. + this.provisioningStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.apigeeregistry.v1.Provisioning' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.apigeeregistry.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 = [ + 'createInstance', + 'deleteInstance', + 'getInstance', + ]; + 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. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'apigeeregistry.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'apigeeregistry.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Gets details of a single Instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Instance to retrieve. + * Format: `projects/* /locations/* /instances/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.apigeeregistry.v1.Instance|Instance}. + * 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_instance.js + * region_tag:apigeeregistry_v1_generated_Provisioning_GetInstance_async + */ + getInstance( + request?: protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest | undefined, + {} | undefined, + ] + >; + getInstance( + request: protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IInstance, + | protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getInstance( + request: protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IInstance, + | protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getInstance( + request?: protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IInstance, + | protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IInstance, + | protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest | 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.getInstance(request, options, callback); + } + + /** + * Provisions instance resources for the Registry. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource of the Instance, of the form: `projects/* /locations/*` + * @param {string} request.instanceId + * Required. Identifier to assign to the Instance. Must be unique within scope of the + * parent resource. + * @param {google.cloud.apigeeregistry.v1.Instance} request.instance + * Required. The 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_instance.js + * region_tag:apigeeregistry_v1_generated_Provisioning_CreateInstance_async + */ + createInstance( + request?: protos.google.cloud.apigeeregistry.v1.ICreateInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createInstance( + request: protos.google.cloud.apigeeregistry.v1.ICreateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createInstance( + request: protos.google.cloud.apigeeregistry.v1.ICreateInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createInstance( + request?: protos.google.cloud.apigeeregistry.v1.ICreateInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createInstance(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createInstance()`. + * @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_instance.js + * region_tag:apigeeregistry_v1_generated_Provisioning_CreateInstance_async + */ + async checkCreateInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.apigeeregistry.v1.Instance, + protos.google.cloud.apigeeregistry.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.createInstance, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.apigeeregistry.v1.Instance, + protos.google.cloud.apigeeregistry.v1.OperationMetadata + >; + } + /** + * Deletes the Registry instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Instance to delete. + * Format: `projects/* /locations/* /instances/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.delete_instance.js + * region_tag:apigeeregistry_v1_generated_Provisioning_DeleteInstance_async + */ + deleteInstance( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteInstance( + request: protos.google.cloud.apigeeregistry.v1.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInstance( + request: protos.google.cloud.apigeeregistry.v1.IDeleteInstanceRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInstance( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteInstance(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteInstance()`. + * @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.delete_instance.js + * region_tag:apigeeregistry_v1_generated_Provisioning_DeleteInstance_async + */ + async checkDeleteInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.apigeeregistry.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.deleteInstance, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.apigeeregistry.v1.OperationMetadata + >; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified 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 apiDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} deployment + * @returns {string} Resource name string. + */ + apiDeploymentPath( + project: string, + location: string, + api: string, + deployment: string + ) { + return this.pathTemplates.apiDeploymentPathTemplate.render({ + project: project, + location: location, + api: api, + deployment: deployment, + }); + } + + /** + * Parse the project from ApiDeployment resource. + * + * @param {string} apiDeploymentName + * A fully-qualified path representing ApiDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiDeploymentName(apiDeploymentName: string) { + return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName) + .project; + } + + /** + * Parse the location from ApiDeployment resource. + * + * @param {string} apiDeploymentName + * A fully-qualified path representing ApiDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiDeploymentName(apiDeploymentName: string) { + return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName) + .location; + } + + /** + * Parse the api from ApiDeployment resource. + * + * @param {string} apiDeploymentName + * A fully-qualified path representing ApiDeployment resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiDeploymentName(apiDeploymentName: string) { + return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName) + .api; + } + + /** + * Parse the deployment from ApiDeployment resource. + * + * @param {string} apiDeploymentName + * A fully-qualified path representing ApiDeployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromApiDeploymentName(apiDeploymentName: string) { + return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName) + .deployment; + } + + /** + * Return a fully-qualified apiSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @returns {string} Resource name string. + */ + apiSpecPath( + project: string, + location: string, + api: string, + version: string, + spec: string + ) { + return this.pathTemplates.apiSpecPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + spec: spec, + }); + } + + /** + * Parse the project from ApiSpec resource. + * + * @param {string} apiSpecName + * A fully-qualified path representing ApiSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiSpecName(apiSpecName: string) { + return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).project; + } + + /** + * Parse the location from ApiSpec resource. + * + * @param {string} apiSpecName + * A fully-qualified path representing ApiSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiSpecName(apiSpecName: string) { + return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).location; + } + + /** + * Parse the api from ApiSpec resource. + * + * @param {string} apiSpecName + * A fully-qualified path representing ApiSpec resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiSpecName(apiSpecName: string) { + return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).api; + } + + /** + * Parse the version from ApiSpec resource. + * + * @param {string} apiSpecName + * A fully-qualified path representing ApiSpec resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiSpecName(apiSpecName: string) { + return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).version; + } + + /** + * Parse the spec from ApiSpec resource. + * + * @param {string} apiSpecName + * A fully-qualified path representing ApiSpec resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromApiSpecName(apiSpecName: string) { + return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).spec; + } + + /** + * Return a fully-qualified apiVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @returns {string} Resource name string. + */ + apiVersionPath( + project: string, + location: string, + api: string, + version: string + ) { + return this.pathTemplates.apiVersionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + }); + } + + /** + * Parse the project from ApiVersion resource. + * + * @param {string} apiVersionName + * A fully-qualified path representing ApiVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiVersionName(apiVersionName: string) { + return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName) + .project; + } + + /** + * Parse the location from ApiVersion resource. + * + * @param {string} apiVersionName + * A fully-qualified path representing ApiVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiVersionName(apiVersionName: string) { + return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName) + .location; + } + + /** + * Parse the api from ApiVersion resource. + * + * @param {string} apiVersionName + * A fully-qualified path representing ApiVersion resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiVersionName(apiVersionName: string) { + return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName).api; + } + + /** + * Parse the version from ApiVersion resource. + * + * @param {string} apiVersionName + * A fully-qualified path representing ApiVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiVersionName(apiVersionName: string) { + return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName) + .version; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project: string, location: string, instance: string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * 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 projectLocationApiArtifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} artifact + * @returns {string} Resource name string. + */ + projectLocationApiArtifactPath( + project: string, + location: string, + api: string, + artifact: string + ) { + return this.pathTemplates.projectLocationApiArtifactPathTemplate.render({ + project: project, + location: location, + api: api, + artifact: artifact, + }); + } + + /** + * Parse the project from ProjectLocationApiArtifact resource. + * + * @param {string} projectLocationApiArtifactName + * A fully-qualified path representing project_location_api_artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationApiArtifactName( + projectLocationApiArtifactName: string + ) { + return this.pathTemplates.projectLocationApiArtifactPathTemplate.match( + projectLocationApiArtifactName + ).project; + } + + /** + * Parse the location from ProjectLocationApiArtifact resource. + * + * @param {string} projectLocationApiArtifactName + * A fully-qualified path representing project_location_api_artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationApiArtifactName( + projectLocationApiArtifactName: string + ) { + return this.pathTemplates.projectLocationApiArtifactPathTemplate.match( + projectLocationApiArtifactName + ).location; + } + + /** + * Parse the api from ProjectLocationApiArtifact resource. + * + * @param {string} projectLocationApiArtifactName + * A fully-qualified path representing project_location_api_artifact resource. + * @returns {string} A string representing the api. + */ + matchApiFromProjectLocationApiArtifactName( + projectLocationApiArtifactName: string + ) { + return this.pathTemplates.projectLocationApiArtifactPathTemplate.match( + projectLocationApiArtifactName + ).api; + } + + /** + * Parse the artifact from ProjectLocationApiArtifact resource. + * + * @param {string} projectLocationApiArtifactName + * A fully-qualified path representing project_location_api_artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromProjectLocationApiArtifactName( + projectLocationApiArtifactName: string + ) { + return this.pathTemplates.projectLocationApiArtifactPathTemplate.match( + projectLocationApiArtifactName + ).artifact; + } + + /** + * Return a fully-qualified projectLocationApiDeploymentArtifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} deployment + * @param {string} artifact + * @returns {string} Resource name string. + */ + projectLocationApiDeploymentArtifactPath( + project: string, + location: string, + api: string, + deployment: string, + artifact: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.render( + { + project: project, + location: location, + api: api, + deployment: deployment, + artifact: artifact, + } + ); + } + + /** + * Parse the project from ProjectLocationApiDeploymentArtifact resource. + * + * @param {string} projectLocationApiDeploymentArtifactName + * A fully-qualified path representing project_location_api_deployment_artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationApiDeploymentArtifactName( + projectLocationApiDeploymentArtifactName: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match( + projectLocationApiDeploymentArtifactName + ).project; + } + + /** + * Parse the location from ProjectLocationApiDeploymentArtifact resource. + * + * @param {string} projectLocationApiDeploymentArtifactName + * A fully-qualified path representing project_location_api_deployment_artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationApiDeploymentArtifactName( + projectLocationApiDeploymentArtifactName: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match( + projectLocationApiDeploymentArtifactName + ).location; + } + + /** + * Parse the api from ProjectLocationApiDeploymentArtifact resource. + * + * @param {string} projectLocationApiDeploymentArtifactName + * A fully-qualified path representing project_location_api_deployment_artifact resource. + * @returns {string} A string representing the api. + */ + matchApiFromProjectLocationApiDeploymentArtifactName( + projectLocationApiDeploymentArtifactName: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match( + projectLocationApiDeploymentArtifactName + ).api; + } + + /** + * Parse the deployment from ProjectLocationApiDeploymentArtifact resource. + * + * @param {string} projectLocationApiDeploymentArtifactName + * A fully-qualified path representing project_location_api_deployment_artifact resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromProjectLocationApiDeploymentArtifactName( + projectLocationApiDeploymentArtifactName: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match( + projectLocationApiDeploymentArtifactName + ).deployment; + } + + /** + * Parse the artifact from ProjectLocationApiDeploymentArtifact resource. + * + * @param {string} projectLocationApiDeploymentArtifactName + * A fully-qualified path representing project_location_api_deployment_artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromProjectLocationApiDeploymentArtifactName( + projectLocationApiDeploymentArtifactName: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match( + projectLocationApiDeploymentArtifactName + ).artifact; + } + + /** + * Return a fully-qualified projectLocationApiVersionArtifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} artifact + * @returns {string} Resource name string. + */ + projectLocationApiVersionArtifactPath( + project: string, + location: string, + api: string, + version: string, + artifact: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.render( + { + project: project, + location: location, + api: api, + version: version, + artifact: artifact, + } + ); + } + + /** + * Parse the project from ProjectLocationApiVersionArtifact resource. + * + * @param {string} projectLocationApiVersionArtifactName + * A fully-qualified path representing project_location_api_version_artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationApiVersionArtifactName( + projectLocationApiVersionArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match( + projectLocationApiVersionArtifactName + ).project; + } + + /** + * Parse the location from ProjectLocationApiVersionArtifact resource. + * + * @param {string} projectLocationApiVersionArtifactName + * A fully-qualified path representing project_location_api_version_artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationApiVersionArtifactName( + projectLocationApiVersionArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match( + projectLocationApiVersionArtifactName + ).location; + } + + /** + * Parse the api from ProjectLocationApiVersionArtifact resource. + * + * @param {string} projectLocationApiVersionArtifactName + * A fully-qualified path representing project_location_api_version_artifact resource. + * @returns {string} A string representing the api. + */ + matchApiFromProjectLocationApiVersionArtifactName( + projectLocationApiVersionArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match( + projectLocationApiVersionArtifactName + ).api; + } + + /** + * Parse the version from ProjectLocationApiVersionArtifact resource. + * + * @param {string} projectLocationApiVersionArtifactName + * A fully-qualified path representing project_location_api_version_artifact resource. + * @returns {string} A string representing the version. + */ + matchVersionFromProjectLocationApiVersionArtifactName( + projectLocationApiVersionArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match( + projectLocationApiVersionArtifactName + ).version; + } + + /** + * Parse the artifact from ProjectLocationApiVersionArtifact resource. + * + * @param {string} projectLocationApiVersionArtifactName + * A fully-qualified path representing project_location_api_version_artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromProjectLocationApiVersionArtifactName( + projectLocationApiVersionArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match( + projectLocationApiVersionArtifactName + ).artifact; + } + + /** + * Return a fully-qualified projectLocationApiVersionSpecArtifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @param {string} artifact + * @returns {string} Resource name string. + */ + projectLocationApiVersionSpecArtifactPath( + project: string, + location: string, + api: string, + version: string, + spec: string, + artifact: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.render( + { + project: project, + location: location, + api: api, + version: version, + spec: spec, + artifact: artifact, + } + ); + } + + /** + * Parse the project from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).project; + } + + /** + * Parse the location from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).location; + } + + /** + * Parse the api from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the api. + */ + matchApiFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).api; + } + + /** + * Parse the version from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the version. + */ + matchVersionFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).version; + } + + /** + * Parse the spec from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).spec; + } + + /** + * Parse the artifact from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).artifact; + } + + /** + * Return a fully-qualified projectLocationArtifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} artifact + * @returns {string} Resource name string. + */ + projectLocationArtifactPath( + project: string, + location: string, + artifact: string + ) { + return this.pathTemplates.projectLocationArtifactPathTemplate.render({ + project: project, + location: location, + artifact: artifact, + }); + } + + /** + * Parse the project from ProjectLocationArtifact resource. + * + * @param {string} projectLocationArtifactName + * A fully-qualified path representing project_location_artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationArtifactName( + projectLocationArtifactName: string + ) { + return this.pathTemplates.projectLocationArtifactPathTemplate.match( + projectLocationArtifactName + ).project; + } + + /** + * Parse the location from ProjectLocationArtifact resource. + * + * @param {string} projectLocationArtifactName + * A fully-qualified path representing project_location_artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationArtifactName( + projectLocationArtifactName: string + ) { + return this.pathTemplates.projectLocationArtifactPathTemplate.match( + projectLocationArtifactName + ).location; + } + + /** + * Parse the artifact from ProjectLocationArtifact resource. + * + * @param {string} projectLocationArtifactName + * A fully-qualified path representing project_location_artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromProjectLocationArtifactName( + projectLocationArtifactName: string + ) { + return this.pathTemplates.projectLocationArtifactPathTemplate.match( + projectLocationArtifactName + ).artifact; + } + + /** + * 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.iamClient.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-apigeeregistry/src/v1/provisioning_client_config.json b/packages/google-cloud-apigeeregistry/src/v1/provisioning_client_config.json new file mode 100644 index 00000000000..2e37ea87f55 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/src/v1/provisioning_client_config.json @@ -0,0 +1,38 @@ +{ + "interfaces": { + "google.cloud.apigeeregistry.v1.Provisioning": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateInstance": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstance": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInstance": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-apigeeregistry/src/v1/provisioning_proto_list.json b/packages/google-cloud-apigeeregistry/src/v1/provisioning_proto_list.json new file mode 100644 index 00000000000..4fdc846ee2b --- /dev/null +++ b/packages/google-cloud-apigeeregistry/src/v1/provisioning_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/cloud/apigeeregistry/v1/provisioning_service.proto", + "../../protos/google/cloud/apigeeregistry/v1/registry_models.proto", + "../../protos/google/cloud/apigeeregistry/v1/registry_service.proto" +] diff --git a/packages/google-cloud-apigeeregistry/src/v1/registry_client.ts b/packages/google-cloud-apigeeregistry/src/v1/registry_client.ts new file mode 100644 index 00000000000..411181dcd3f --- /dev/null +++ b/packages/google-cloud-apigeeregistry/src/v1/registry_client.ts @@ -0,0 +1,5782 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/registry_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './registry_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The Registry service allows teams to manage descriptions of APIs. + * @class + * @memberof v1 + */ +export class RegistryClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + registryStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RegistryClient. + * + * @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 RegistryClient({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 RegistryClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + apiPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}' + ), + apiDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}' + ), + apiSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}' + ), + apiVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectLocationApiArtifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/artifacts/{artifact}' + ), + projectLocationApiDeploymentArtifactPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}/artifacts/{artifact}' + ), + projectLocationApiVersionArtifactPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/artifacts/{artifact}' + ), + projectLocationApiVersionSpecArtifactPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}/artifacts/{artifact}' + ), + projectLocationArtifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/artifacts/{artifact}' + ), + }; + + // 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' + ), + listApiVersions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'apiVersions' + ), + listApiSpecs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'apiSpecs' + ), + listApiSpecRevisions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'apiSpecs' + ), + listApiDeployments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'apiDeployments' + ), + listApiDeploymentRevisions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'apiDeployments' + ), + listArtifacts: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'artifacts' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.apigeeregistry.v1.Registry', + 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.registryStub) { + return this.registryStub; + } + + // Put together the "service stub" for + // google.cloud.apigeeregistry.v1.Registry. + this.registryStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.apigeeregistry.v1.Registry' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.apigeeregistry.v1.Registry, + 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 registryStubMethods = [ + 'listApis', + 'getApi', + 'createApi', + 'updateApi', + 'deleteApi', + 'listApiVersions', + 'getApiVersion', + 'createApiVersion', + 'updateApiVersion', + 'deleteApiVersion', + 'listApiSpecs', + 'getApiSpec', + 'getApiSpecContents', + 'createApiSpec', + 'updateApiSpec', + 'deleteApiSpec', + 'tagApiSpecRevision', + 'listApiSpecRevisions', + 'rollbackApiSpec', + 'deleteApiSpecRevision', + 'listApiDeployments', + 'getApiDeployment', + 'createApiDeployment', + 'updateApiDeployment', + 'deleteApiDeployment', + 'tagApiDeploymentRevision', + 'listApiDeploymentRevisions', + 'rollbackApiDeployment', + 'deleteApiDeploymentRevision', + 'listArtifacts', + 'getArtifact', + 'getArtifactContents', + 'createArtifact', + 'replaceArtifact', + 'deleteArtifact', + ]; + for (const methodName of registryStubMethods) { + const callPromise = this.registryStub.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.registryStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'apigeeregistry.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'apigeeregistry.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Returns a specified API. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the API to retrieve. + * Format: `projects/* /locations/* /apis/*` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.apigeeregistry.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/registry.get_api.js + * region_tag:apigeeregistry_v1_generated_Registry_GetApi_async + */ + getApi( + request?: protos.google.cloud.apigeeregistry.v1.IGetApiRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApi, + protos.google.cloud.apigeeregistry.v1.IGetApiRequest | undefined, + {} | undefined, + ] + >; + getApi( + request: protos.google.cloud.apigeeregistry.v1.IGetApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + protos.google.cloud.apigeeregistry.v1.IGetApiRequest | null | undefined, + {} | null | undefined + > + ): void; + getApi( + request: protos.google.cloud.apigeeregistry.v1.IGetApiRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + protos.google.cloud.apigeeregistry.v1.IGetApiRequest | null | undefined, + {} | null | undefined + > + ): void; + getApi( + request?: protos.google.cloud.apigeeregistry.v1.IGetApiRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + | protos.google.cloud.apigeeregistry.v1.IGetApiRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + protos.google.cloud.apigeeregistry.v1.IGetApiRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApi, + protos.google.cloud.apigeeregistry.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); + } + /** + * Creates a specified API. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of APIs. + * Format: `projects/* /locations/*` + * @param {google.cloud.apigeeregistry.v1.Api} request.api + * Required. The API to create. + * @param {string} request.apiId + * Required. The ID to use for the API, which will become the final component of + * the API's resource name. + * + * This value should be 4-63 characters, and valid characters + * are /{@link protos.0-9|a-z}-/. + * + * Following AIP-162, IDs must not have the form of a UUID. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.apigeeregistry.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/registry.create_api.js + * region_tag:apigeeregistry_v1_generated_Registry_CreateApi_async + */ + createApi( + request?: protos.google.cloud.apigeeregistry.v1.ICreateApiRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApi, + protos.google.cloud.apigeeregistry.v1.ICreateApiRequest | undefined, + {} | undefined, + ] + >; + createApi( + request: protos.google.cloud.apigeeregistry.v1.ICreateApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + | protos.google.cloud.apigeeregistry.v1.ICreateApiRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createApi( + request: protos.google.cloud.apigeeregistry.v1.ICreateApiRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + | protos.google.cloud.apigeeregistry.v1.ICreateApiRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createApi( + request?: protos.google.cloud.apigeeregistry.v1.ICreateApiRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + | protos.google.cloud.apigeeregistry.v1.ICreateApiRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + | protos.google.cloud.apigeeregistry.v1.ICreateApiRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApi, + protos.google.cloud.apigeeregistry.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); + } + /** + * Used to modify a specified API. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apigeeregistry.v1.Api} request.api + * Required. The API to update. + * + * The `name` field is used to identify the API to update. + * Format: `projects/* /locations/* /apis/*` + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. If omitted, all fields are updated that + * are set in the request message (fields set to default values are ignored). + * If an asterisk "*" is specified, all fields are updated, including fields + * that are unspecified/default in the request. + * @param {boolean} request.allowMissing + * If set to true, and the API is not found, a new API will be created. + * In this situation, `update_mask` is ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.apigeeregistry.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/registry.update_api.js + * region_tag:apigeeregistry_v1_generated_Registry_UpdateApi_async + */ + updateApi( + request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApi, + protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest | undefined, + {} | undefined, + ] + >; + updateApi( + request: protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateApi( + request: protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateApi( + request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApi, + protos.google.cloud.apigeeregistry.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); + } + /** + * Removes a specified API and all of the resources that it + * owns. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the API to delete. + * Format: `projects/* /locations/* /apis/*` + * @param {boolean} request.force + * If set to true, any child resources will also be deleted. + * (Otherwise, the request will only work if there are no child resources.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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/registry.delete_api.js + * region_tag:apigeeregistry_v1_generated_Registry_DeleteApi_async + */ + deleteApi( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest | undefined, + {} | undefined, + ] + >; + deleteApi( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApi( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApi( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.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); + } + /** + * Returns a specified version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the version to retrieve. + * Format: `projects/* /locations/* /apis/* /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.cloud.apigeeregistry.v1.ApiVersion|ApiVersion}. + * 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/registry.get_api_version.js + * region_tag:apigeeregistry_v1_generated_Registry_GetApiVersion_async + */ + getApiVersion( + request?: protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiVersion, + protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest | undefined, + {} | undefined, + ] + >; + getApiVersion( + request: protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getApiVersion( + request: protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getApiVersion( + request?: protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiVersion, + protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest | 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.getApiVersion(request, options, callback); + } + /** + * Creates a specified version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of versions. + * Format: `projects/* /locations/* /apis/*` + * @param {google.cloud.apigeeregistry.v1.ApiVersion} request.apiVersion + * Required. The version to create. + * @param {string} request.apiVersionId + * Required. The ID to use for the version, which will become the final component of + * the version's resource name. + * + * This value should be 1-63 characters, and valid characters + * are /{@link protos.0-9|a-z}-/. + * + * Following AIP-162, IDs must not have the form of a UUID. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.apigeeregistry.v1.ApiVersion|ApiVersion}. + * 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/registry.create_api_version.js + * region_tag:apigeeregistry_v1_generated_Registry_CreateApiVersion_async + */ + createApiVersion( + request?: protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiVersion, + ( + | protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest + | undefined + ), + {} | undefined, + ] + >; + createApiVersion( + request: protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createApiVersion( + request: protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createApiVersion( + request?: protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiVersion, + ( + | protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest + | 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.createApiVersion(request, options, callback); + } + /** + * Used to modify a specified version. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apigeeregistry.v1.ApiVersion} request.apiVersion + * Required. The version to update. + * + * The `name` field is used to identify the version to update. + * Format: `projects/* /locations/* /apis/* /versions/*` + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. If omitted, all fields are updated that + * are set in the request message (fields set to default values are ignored). + * If an asterisk "*" is specified, all fields are updated, including fields + * that are unspecified/default in the request. + * @param {boolean} request.allowMissing + * If set to true, and the version is not found, a new version will be + * created. In this situation, `update_mask` is ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.apigeeregistry.v1.ApiVersion|ApiVersion}. + * 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/registry.update_api_version.js + * region_tag:apigeeregistry_v1_generated_Registry_UpdateApiVersion_async + */ + updateApiVersion( + request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiVersion, + ( + | protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest + | undefined + ), + {} | undefined, + ] + >; + updateApiVersion( + request: protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateApiVersion( + request: protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateApiVersion( + request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiVersion, + ( + | protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest + | 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_version.name': request.apiVersion!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateApiVersion(request, options, callback); + } + /** + * Removes a specified version and all of the resources that + * it owns. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the version to delete. + * Format: `projects/* /locations/* /apis/* /versions/*` + * @param {boolean} request.force + * If set to true, any child resources will also be deleted. + * (Otherwise, the request will only work if there are no child resources.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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/registry.delete_api_version.js + * region_tag:apigeeregistry_v1_generated_Registry_DeleteApiVersion_async + */ + deleteApiVersion( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest + | undefined + ), + {} | undefined, + ] + >; + deleteApiVersion( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApiVersion( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApiVersion( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest + | 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.deleteApiVersion(request, options, callback); + } + /** + * Returns a specified spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec to retrieve. + * Format: `projects/* /locations/* /apis/* /versions/* /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.cloud.apigeeregistry.v1.ApiSpec|ApiSpec}. + * 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/registry.get_api_spec.js + * region_tag:apigeeregistry_v1_generated_Registry_GetApiSpec_async + */ + getApiSpec( + request?: protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest | undefined, + {} | undefined, + ] + >; + getApiSpec( + request: protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getApiSpec( + request: protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getApiSpec( + request?: protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest | 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.getApiSpec(request, options, callback); + } + /** + * Returns the contents of a specified spec. + * If specs are stored with GZip compression, the default behavior + * is to return the spec uncompressed (the mime_type response field + * indicates the exact format returned). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec whose contents should be retrieved. + * Format: `projects/* /locations/* /apis/* /versions/* /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.api.HttpBody|HttpBody}. + * 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/registry.get_api_spec_contents.js + * region_tag:apigeeregistry_v1_generated_Registry_GetApiSpecContents_async + */ + getApiSpecContents( + request?: protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.api.IHttpBody, + ( + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest + | undefined + ), + {} | undefined, + ] + >; + getApiSpecContents( + request: protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest, + options: CallOptions, + callback: Callback< + protos.google.api.IHttpBody, + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getApiSpecContents( + request: protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest, + callback: Callback< + protos.google.api.IHttpBody, + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getApiSpecContents( + request?: protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.api.IHttpBody, + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.api.IHttpBody, + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.api.IHttpBody, + ( + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest + | 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.getApiSpecContents(request, options, callback); + } + /** + * Creates a specified spec. + * + * @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/* /locations/* /apis/* /versions/*` + * @param {google.cloud.apigeeregistry.v1.ApiSpec} request.apiSpec + * Required. The spec to create. + * @param {string} request.apiSpecId + * Required. The ID to use for the spec, which will become the final component of + * the spec's resource name. + * + * This value should be 4-63 characters, and valid characters + * are /{@link protos.0-9|a-z}-/. + * + * Following AIP-162, IDs must not have the form of a UUID. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.apigeeregistry.v1.ApiSpec|ApiSpec}. + * 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/registry.create_api_spec.js + * region_tag:apigeeregistry_v1_generated_Registry_CreateApiSpec_async + */ + createApiSpec( + request?: protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest | undefined, + {} | undefined, + ] + >; + createApiSpec( + request: protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createApiSpec( + request: protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createApiSpec( + request?: protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest | 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.createApiSpec(request, options, callback); + } + /** + * Used to modify a specified spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apigeeregistry.v1.ApiSpec} request.apiSpec + * Required. The spec to update. + * + * The `name` field is used to identify the spec to update. + * Format: `projects/* /locations/* /apis/* /versions/* /specs/*` + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. If omitted, all fields are updated that + * are set in the request message (fields set to default values are ignored). + * If an asterisk "*" is specified, all fields are updated, including fields + * that are unspecified/default in the request. + * @param {boolean} request.allowMissing + * If set to true, and the spec is not found, a new spec will be created. + * In this situation, `update_mask` is ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.apigeeregistry.v1.ApiSpec|ApiSpec}. + * 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/registry.update_api_spec.js + * region_tag:apigeeregistry_v1_generated_Registry_UpdateApiSpec_async + */ + updateApiSpec( + request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest | undefined, + {} | undefined, + ] + >; + updateApiSpec( + request: protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateApiSpec( + request: protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateApiSpec( + request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest | 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_spec.name': request.apiSpec!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateApiSpec(request, options, callback); + } + /** + * Removes a specified spec, all revisions, and all child + * resources (e.g., artifacts). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec to delete. + * Format: `projects/* /locations/* /apis/* /versions/* /specs/*` + * @param {boolean} request.force + * If set to true, any child resources will also be deleted. + * (Otherwise, the request will only work if there are no child resources.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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/registry.delete_api_spec.js + * region_tag:apigeeregistry_v1_generated_Registry_DeleteApiSpec_async + */ + deleteApiSpec( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest | undefined, + {} | undefined, + ] + >; + deleteApiSpec( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApiSpec( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApiSpec( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest | 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.deleteApiSpec(request, options, callback); + } + /** + * Adds a tag to a specified revision of a spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec to be tagged, including the revision ID. + * @param {string} request.tag + * Required. The tag to apply. + * The tag should be at most 40 characters, and match `{@link protos.a-z0-9-|a-z}{3,39}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.apigeeregistry.v1.ApiSpec|ApiSpec}. + * 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/registry.tag_api_spec_revision.js + * region_tag:apigeeregistry_v1_generated_Registry_TagApiSpecRevision_async + */ + tagApiSpecRevision( + request?: protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + ( + | protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest + | undefined + ), + {} | undefined, + ] + >; + tagApiSpecRevision( + request: protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + tagApiSpecRevision( + request: protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + tagApiSpecRevision( + request?: protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + ( + | protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest + | 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.tagApiSpecRevision(request, options, callback); + } + /** + * Sets the current revision to a specified prior revision. + * Note that this creates a new revision with a new revision ID. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The spec being rolled back. + * @param {string} request.revisionId + * Required. The revision ID to roll back to. + * It must be a revision of the same spec. + * + * Example: `c7cfa2a8` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.apigeeregistry.v1.ApiSpec|ApiSpec}. + * 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/registry.rollback_api_spec.js + * region_tag:apigeeregistry_v1_generated_Registry_RollbackApiSpec_async + */ + rollbackApiSpec( + request?: protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest | undefined, + {} | undefined, + ] + >; + rollbackApiSpec( + request: protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + rollbackApiSpec( + request: protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): void; + rollbackApiSpec( + request?: protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest | 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.rollbackApiSpec(request, options, callback); + } + /** + * Deletes a revision of a spec. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec revision to be deleted, + * with a revision ID explicitly included. + * + * Example: + * `projects/sample/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml@c7cfa2a8` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.apigeeregistry.v1.ApiSpec|ApiSpec}. + * 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/registry.delete_api_spec_revision.js + * region_tag:apigeeregistry_v1_generated_Registry_DeleteApiSpecRevision_async + */ + deleteApiSpecRevision( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + ( + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest + | undefined + ), + {} | undefined, + ] + >; + deleteApiSpecRevision( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApiSpecRevision( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApiSpecRevision( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + ( + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest + | 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.deleteApiSpecRevision(request, options, callback); + } + /** + * Returns a specified deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment to retrieve. + * Format: `projects/* /locations/* /apis/* /deployments/*` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.apigeeregistry.v1.ApiDeployment|ApiDeployment}. + * 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/registry.get_api_deployment.js + * region_tag:apigeeregistry_v1_generated_Registry_GetApiDeployment_async + */ + getApiDeployment( + request?: protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest + | undefined + ), + {} | undefined, + ] + >; + getApiDeployment( + request: protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getApiDeployment( + request: protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getApiDeployment( + request?: protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest + | 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.getApiDeployment(request, options, callback); + } + /** + * Creates a specified deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployments. + * Format: `projects/* /locations/* /apis/*` + * @param {google.cloud.apigeeregistry.v1.ApiDeployment} request.apiDeployment + * Required. The deployment to create. + * @param {string} request.apiDeploymentId + * Required. The ID to use for the deployment, which will become the final component of + * the deployment's resource name. + * + * This value should be 4-63 characters, and valid characters + * are /{@link protos.0-9|a-z}-/. + * + * Following AIP-162, IDs must not have the form of a UUID. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.apigeeregistry.v1.ApiDeployment|ApiDeployment}. + * 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/registry.create_api_deployment.js + * region_tag:apigeeregistry_v1_generated_Registry_CreateApiDeployment_async + */ + createApiDeployment( + request?: protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest + | undefined + ), + {} | undefined, + ] + >; + createApiDeployment( + request: protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createApiDeployment( + request: protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createApiDeployment( + request?: protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest + | 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.createApiDeployment(request, options, callback); + } + /** + * Used to modify a specified deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apigeeregistry.v1.ApiDeployment} request.apiDeployment + * Required. The deployment to update. + * + * The `name` field is used to identify the deployment to update. + * Format: `projects/* /locations/* /apis/* /deployments/*` + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. If omitted, all fields are updated that + * are set in the request message (fields set to default values are ignored). + * If an asterisk "*" is specified, all fields are updated, including fields + * that are unspecified/default in the request. + * @param {boolean} request.allowMissing + * If set to true, and the deployment is not found, a new deployment will be + * created. In this situation, `update_mask` is ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.apigeeregistry.v1.ApiDeployment|ApiDeployment}. + * 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/registry.update_api_deployment.js + * region_tag:apigeeregistry_v1_generated_Registry_UpdateApiDeployment_async + */ + updateApiDeployment( + request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest + | undefined + ), + {} | undefined, + ] + >; + updateApiDeployment( + request: protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateApiDeployment( + request: protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateApiDeployment( + request?: protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest + | 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_deployment.name': request.apiDeployment!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateApiDeployment(request, options, callback); + } + /** + * Removes a specified deployment, all revisions, and all + * child resources (e.g., artifacts). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment to delete. + * Format: `projects/* /locations/* /apis/* /deployments/*` + * @param {boolean} request.force + * If set to true, any child resources will also be deleted. + * (Otherwise, the request will only work if there are no child resources.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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/registry.delete_api_deployment.js + * region_tag:apigeeregistry_v1_generated_Registry_DeleteApiDeployment_async + */ + deleteApiDeployment( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest + | undefined + ), + {} | undefined, + ] + >; + deleteApiDeployment( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApiDeployment( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApiDeployment( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest + | 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.deleteApiDeployment(request, options, callback); + } + /** + * Adds a tag to a specified revision of a + * deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment to be tagged, including the revision ID. + * @param {string} request.tag + * Required. The tag to apply. + * The tag should be at most 40 characters, and match `{@link protos.a-z0-9-|a-z}{3,39}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.apigeeregistry.v1.ApiDeployment|ApiDeployment}. + * 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/registry.tag_api_deployment_revision.js + * region_tag:apigeeregistry_v1_generated_Registry_TagApiDeploymentRevision_async + */ + tagApiDeploymentRevision( + request?: protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest + | undefined + ), + {} | undefined, + ] + >; + tagApiDeploymentRevision( + request: protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + tagApiDeploymentRevision( + request: protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + tagApiDeploymentRevision( + request?: protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest + | 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.tagApiDeploymentRevision( + request, + options, + callback + ); + } + /** + * Sets the current revision to a specified prior + * revision. Note that this creates a new revision with a new revision ID. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The deployment being rolled back. + * @param {string} request.revisionId + * Required. The revision ID to roll back to. + * It must be a revision of the same deployment. + * + * Example: `c7cfa2a8` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.apigeeregistry.v1.ApiDeployment|ApiDeployment}. + * 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/registry.rollback_api_deployment.js + * region_tag:apigeeregistry_v1_generated_Registry_RollbackApiDeployment_async + */ + rollbackApiDeployment( + request?: protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest + | undefined + ), + {} | undefined, + ] + >; + rollbackApiDeployment( + request: protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + rollbackApiDeployment( + request: protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + rollbackApiDeployment( + request?: protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest + | 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.rollbackApiDeployment(request, options, callback); + } + /** + * Deletes a revision of a deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment revision to be deleted, + * with a revision ID explicitly included. + * + * Example: + * `projects/sample/locations/global/apis/petstore/deployments/prod@c7cfa2a8` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.apigeeregistry.v1.ApiDeployment|ApiDeployment}. + * 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/registry.delete_api_deployment_revision.js + * region_tag:apigeeregistry_v1_generated_Registry_DeleteApiDeploymentRevision_async + */ + deleteApiDeploymentRevision( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest + | undefined + ), + {} | undefined, + ] + >; + deleteApiDeploymentRevision( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApiDeploymentRevision( + request: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteApiDeploymentRevision( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest + | 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.deleteApiDeploymentRevision( + request, + options, + callback + ); + } + /** + * Returns a specified artifact. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the artifact to retrieve. + * Format: `{parent}/artifacts/*` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.apigeeregistry.v1.Artifact|Artifact}. + * 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/registry.get_artifact.js + * region_tag:apigeeregistry_v1_generated_Registry_GetArtifact_async + */ + getArtifact( + request?: protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IArtifact, + protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest | undefined, + {} | undefined, + ] + >; + getArtifact( + request: protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getArtifact( + request: protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getArtifact( + request?: protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IArtifact, + protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest | 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.getArtifact(request, options, callback); + } + /** + * Returns the contents of a specified artifact. + * If artifacts are stored with GZip compression, the default behavior + * is to return the artifact uncompressed (the mime_type response field + * indicates the exact format returned). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the artifact whose contents should be retrieved. + * Format: `{parent}/artifacts/*` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.api.HttpBody|HttpBody}. + * 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/registry.get_artifact_contents.js + * region_tag:apigeeregistry_v1_generated_Registry_GetArtifactContents_async + */ + getArtifactContents( + request?: protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.api.IHttpBody, + ( + | protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest + | undefined + ), + {} | undefined, + ] + >; + getArtifactContents( + request: protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest, + options: CallOptions, + callback: Callback< + protos.google.api.IHttpBody, + | protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getArtifactContents( + request: protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest, + callback: Callback< + protos.google.api.IHttpBody, + | protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getArtifactContents( + request?: protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.api.IHttpBody, + | protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.api.IHttpBody, + | protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.api.IHttpBody, + ( + | protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest + | 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.getArtifactContents(request, options, callback); + } + /** + * Creates a specified artifact. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of artifacts. + * Format: `{parent}` + * @param {google.cloud.apigeeregistry.v1.Artifact} request.artifact + * Required. The artifact to create. + * @param {string} request.artifactId + * Required. The ID to use for the artifact, which will become the final component of + * the artifact's resource name. + * + * This value should be 4-63 characters, and valid characters + * are /{@link protos.0-9|a-z}-/. + * + * Following AIP-162, IDs must not have the form of a UUID. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.apigeeregistry.v1.Artifact|Artifact}. + * 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/registry.create_artifact.js + * region_tag:apigeeregistry_v1_generated_Registry_CreateArtifact_async + */ + createArtifact( + request?: protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IArtifact, + protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest | undefined, + {} | undefined, + ] + >; + createArtifact( + request: protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createArtifact( + request: protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createArtifact( + request?: protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IArtifact, + protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest | 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.createArtifact(request, options, callback); + } + /** + * Used to replace a specified artifact. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.apigeeregistry.v1.Artifact} request.artifact + * Required. The artifact to replace. + * + * The `name` field is used to identify the artifact to replace. + * Format: `{parent}/artifacts/*` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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.apigeeregistry.v1.Artifact|Artifact}. + * 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/registry.replace_artifact.js + * region_tag:apigeeregistry_v1_generated_Registry_ReplaceArtifact_async + */ + replaceArtifact( + request?: protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IArtifact, + protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest | undefined, + {} | undefined, + ] + >; + replaceArtifact( + request: protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + replaceArtifact( + request: protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest, + callback: Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + replaceArtifact( + request?: protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IArtifact, + protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest | 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({ + 'artifact.name': request.artifact!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.replaceArtifact(request, options, callback); + } + /** + * Removes a specified artifact. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the artifact to delete. + * Format: `{parent}/artifacts/*` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|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/registry.delete_artifact.js + * region_tag:apigeeregistry_v1_generated_Registry_DeleteArtifact_async + */ + deleteArtifact( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest | undefined, + {} | undefined, + ] + >; + deleteArtifact( + request: protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteArtifact( + request: protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteArtifact( + request?: protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest | 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.deleteArtifact(request, options, callback); + } + + /** + * Returns matching APIs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of APIs. + * Format: `projects/* /locations/*` + * @param {number} request.pageSize + * The maximum number of APIs to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApis` must match + * the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.apigeeregistry.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.apigeeregistry.v1.IListApisRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApi[], + protos.google.cloud.apigeeregistry.v1.IListApisRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApisResponse, + ] + >; + listApis( + request: protos.google.cloud.apigeeregistry.v1.IListApisRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApisRequest, + | protos.google.cloud.apigeeregistry.v1.IListApisResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApi + > + ): void; + listApis( + request: protos.google.cloud.apigeeregistry.v1.IListApisRequest, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApisRequest, + | protos.google.cloud.apigeeregistry.v1.IListApisResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApi + > + ): void; + listApis( + request?: protos.google.cloud.apigeeregistry.v1.IListApisRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApisRequest, + | protos.google.cloud.apigeeregistry.v1.IListApisResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApi + >, + callback?: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApisRequest, + | protos.google.cloud.apigeeregistry.v1.IListApisResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApi + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApi[], + protos.google.cloud.apigeeregistry.v1.IListApisRequest | null, + protos.google.cloud.apigeeregistry.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 APIs. + * Format: `projects/* /locations/*` + * @param {number} request.pageSize + * The maximum number of APIs to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApis` must match + * the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + * @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.apigeeregistry.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.apigeeregistry.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 APIs. + * Format: `projects/* /locations/*` + * @param {number} request.pageSize + * The maximum number of APIs to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApis` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApis` must match + * the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + * @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.apigeeregistry.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/registry.list_apis.js + * region_tag:apigeeregistry_v1_generated_Registry_ListApis_async + */ + listApisAsync( + request?: protos.google.cloud.apigeeregistry.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; + } + /** + * Returns matching versions. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of versions. + * Format: `projects/* /locations/* /apis/*` + * @param {number} request.pageSize + * The maximum number of versions to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApiVersions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApiVersions` must + * match the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.apigeeregistry.v1.ApiVersion|ApiVersion}. + * 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 `listApiVersionsAsync()` + * 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. + */ + listApiVersions( + request?: protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiVersion[], + protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiVersionsResponse, + ] + >; + listApiVersions( + request: protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiVersionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiVersion + > + ): void; + listApiVersions( + request: protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiVersionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiVersion + > + ): void; + listApiVersions( + request?: protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiVersionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiVersion + >, + callback?: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiVersionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiVersion + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiVersion[], + protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiVersionsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listApiVersions(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 versions. + * Format: `projects/* /locations/* /apis/*` + * @param {number} request.pageSize + * The maximum number of versions to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApiVersions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApiVersions` must + * match the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + * @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.apigeeregistry.v1.ApiVersion|ApiVersion} 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 `listApiVersionsAsync()` + * 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. + */ + listApiVersionsStream( + request?: protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, + 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['listApiVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiVersions.createStream( + this.innerApiCalls.listApiVersions as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listApiVersions`, 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 versions. + * Format: `projects/* /locations/* /apis/*` + * @param {number} request.pageSize + * The maximum number of versions to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApiVersions` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApiVersions` must + * match the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + * @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.apigeeregistry.v1.ApiVersion|ApiVersion}. 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/registry.list_api_versions.js + * region_tag:apigeeregistry_v1_generated_Registry_ListApiVersions_async + */ + listApiVersionsAsync( + request?: protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, + 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['listApiVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiVersions.asyncIterate( + this.innerApiCalls['listApiVersions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns matching specs. + * + * @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/* /locations/* /apis/* /versions/*` + * @param {number} request.pageSize + * The maximum number of specs to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApiSpecs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApiSpecs` must match + * the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields except contents. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.apigeeregistry.v1.ApiSpec|ApiSpec}. + * 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 `listApiSpecsAsync()` + * 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. + */ + listApiSpecs( + request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec[], + protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiSpecsResponse, + ] + >; + listApiSpecs( + request: protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiSpecsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiSpec + > + ): void; + listApiSpecs( + request: protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiSpecsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiSpec + > + ): void; + listApiSpecs( + request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiSpecsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiSpec + >, + callback?: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiSpecsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiSpec + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec[], + protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiSpecsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listApiSpecs(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/* /locations/* /apis/* /versions/*` + * @param {number} request.pageSize + * The maximum number of specs to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApiSpecs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApiSpecs` must match + * the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields except contents. + * @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.apigeeregistry.v1.ApiSpec|ApiSpec} 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 `listApiSpecsAsync()` + * 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. + */ + listApiSpecsStream( + request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, + 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['listApiSpecs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiSpecs.createStream( + this.innerApiCalls.listApiSpecs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listApiSpecs`, 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/* /locations/* /apis/* /versions/*` + * @param {number} request.pageSize + * The maximum number of specs to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApiSpecs` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApiSpecs` must match + * the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields except contents. + * @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.apigeeregistry.v1.ApiSpec|ApiSpec}. 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/registry.list_api_specs.js + * region_tag:apigeeregistry_v1_generated_Registry_ListApiSpecs_async + */ + listApiSpecsAsync( + request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, + 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['listApiSpecs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiSpecs.asyncIterate( + this.innerApiCalls['listApiSpecs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all revisions of a spec. + * Revisions are returned in descending order of revision creation time. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spec to list revisions for. + * @param {number} request.pageSize + * The maximum number of revisions to return per page. + * @param {string} request.pageToken + * The page token, received from a previous ListApiSpecRevisions call. + * Provide this to retrieve the subsequent page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.apigeeregistry.v1.ApiSpec|ApiSpec}. + * 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 `listApiSpecRevisionsAsync()` + * 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. + */ + listApiSpecRevisions( + request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec[], + protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse, + ] + >; + listApiSpecRevisions( + request: protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiSpec + > + ): void; + listApiSpecRevisions( + request: protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiSpec + > + ): void; + listApiSpecRevisions( + request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiSpec + >, + callback?: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiSpec + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiSpec[], + protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listApiSpecRevisions(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.name + * Required. The name of the spec to list revisions for. + * @param {number} request.pageSize + * The maximum number of revisions to return per page. + * @param {string} request.pageToken + * The page token, received from a previous ListApiSpecRevisions call. + * Provide this to retrieve the subsequent page. + * @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.apigeeregistry.v1.ApiSpec|ApiSpec} 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 `listApiSpecRevisionsAsync()` + * 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. + */ + listApiSpecRevisionsStream( + request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, + 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({ + name: request.name ?? '', + }); + const defaultCallSettings = this._defaults['listApiSpecRevisions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiSpecRevisions.createStream( + this.innerApiCalls.listApiSpecRevisions as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listApiSpecRevisions`, 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.name + * Required. The name of the spec to list revisions for. + * @param {number} request.pageSize + * The maximum number of revisions to return per page. + * @param {string} request.pageToken + * The page token, received from a previous ListApiSpecRevisions call. + * Provide this to retrieve the subsequent page. + * @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.apigeeregistry.v1.ApiSpec|ApiSpec}. 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/registry.list_api_spec_revisions.js + * region_tag:apigeeregistry_v1_generated_Registry_ListApiSpecRevisions_async + */ + listApiSpecRevisionsAsync( + request?: protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, + 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({ + name: request.name ?? '', + }); + const defaultCallSettings = this._defaults['listApiSpecRevisions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiSpecRevisions.asyncIterate( + this.innerApiCalls['listApiSpecRevisions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns matching deployments. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployments. + * Format: `projects/* /locations/* /apis/*` + * @param {number} request.pageSize + * The maximum number of deployments to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApiDeployments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApiDeployments` must + * match the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.apigeeregistry.v1.ApiDeployment|ApiDeployment}. + * 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 `listApiDeploymentsAsync()` + * 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. + */ + listApiDeployments( + request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment[], + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse, + ] + >; + listApiDeployments( + request: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiDeployment + > + ): void; + listApiDeployments( + request: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiDeployment + > + ): void; + listApiDeployments( + request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiDeployment + >, + callback?: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiDeployment + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment[], + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listApiDeployments(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 deployments. + * Format: `projects/* /locations/* /apis/*` + * @param {number} request.pageSize + * The maximum number of deployments to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApiDeployments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApiDeployments` must + * match the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + * @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.apigeeregistry.v1.ApiDeployment|ApiDeployment} 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 `listApiDeploymentsAsync()` + * 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. + */ + listApiDeploymentsStream( + request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, + 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['listApiDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiDeployments.createStream( + this.innerApiCalls.listApiDeployments as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listApiDeployments`, 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 deployments. + * Format: `projects/* /locations/* /apis/*` + * @param {number} request.pageSize + * The maximum number of deployments to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListApiDeployments` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListApiDeployments` must + * match the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields. + * @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.apigeeregistry.v1.ApiDeployment|ApiDeployment}. 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/registry.list_api_deployments.js + * region_tag:apigeeregistry_v1_generated_Registry_ListApiDeployments_async + */ + listApiDeploymentsAsync( + request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, + 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['listApiDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiDeployments.asyncIterate( + this.innerApiCalls['listApiDeployments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all revisions of a deployment. + * Revisions are returned in descending order of revision creation time. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment to list revisions for. + * @param {number} request.pageSize + * The maximum number of revisions to return per page. + * @param {string} request.pageToken + * The page token, received from a previous ListApiDeploymentRevisions call. + * Provide this to retrieve the subsequent page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.apigeeregistry.v1.ApiDeployment|ApiDeployment}. + * 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 `listApiDeploymentRevisionsAsync()` + * 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. + */ + listApiDeploymentRevisions( + request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment[], + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse, + ] + >; + listApiDeploymentRevisions( + request: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiDeployment + > + ): void; + listApiDeploymentRevisions( + request: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiDeployment + > + ): void; + listApiDeploymentRevisions( + request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiDeployment + >, + callback?: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiDeployment + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment[], + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listApiDeploymentRevisions( + 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.name + * Required. The name of the deployment to list revisions for. + * @param {number} request.pageSize + * The maximum number of revisions to return per page. + * @param {string} request.pageToken + * The page token, received from a previous ListApiDeploymentRevisions call. + * Provide this to retrieve the subsequent page. + * @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.apigeeregistry.v1.ApiDeployment|ApiDeployment} 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 `listApiDeploymentRevisionsAsync()` + * 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. + */ + listApiDeploymentRevisionsStream( + request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, + 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({ + name: request.name ?? '', + }); + const defaultCallSettings = this._defaults['listApiDeploymentRevisions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiDeploymentRevisions.createStream( + this.innerApiCalls.listApiDeploymentRevisions as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listApiDeploymentRevisions`, 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.name + * Required. The name of the deployment to list revisions for. + * @param {number} request.pageSize + * The maximum number of revisions to return per page. + * @param {string} request.pageToken + * The page token, received from a previous ListApiDeploymentRevisions call. + * Provide this to retrieve the subsequent page. + * @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.apigeeregistry.v1.ApiDeployment|ApiDeployment}. 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/registry.list_api_deployment_revisions.js + * region_tag:apigeeregistry_v1_generated_Registry_ListApiDeploymentRevisions_async + */ + listApiDeploymentRevisionsAsync( + request?: protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, + 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({ + name: request.name ?? '', + }); + const defaultCallSettings = this._defaults['listApiDeploymentRevisions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listApiDeploymentRevisions.asyncIterate( + this.innerApiCalls['listApiDeploymentRevisions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns matching artifacts. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of artifacts. + * Format: `{parent}` + * @param {number} request.pageSize + * The maximum number of artifacts to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListArtifacts` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListArtifacts` must + * match the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields except contents. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.apigeeregistry.v1.Artifact|Artifact}. + * 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 `listArtifactsAsync()` + * 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. + */ + listArtifacts( + request?: protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IArtifact[], + protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListArtifactsResponse, + ] + >; + listArtifacts( + request: protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, + | protos.google.cloud.apigeeregistry.v1.IListArtifactsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IArtifact + > + ): void; + listArtifacts( + request: protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, + callback: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, + | protos.google.cloud.apigeeregistry.v1.IListArtifactsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IArtifact + > + ): void; + listArtifacts( + request?: protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, + | protos.google.cloud.apigeeregistry.v1.IListArtifactsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IArtifact + >, + callback?: PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, + | protos.google.cloud.apigeeregistry.v1.IListArtifactsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IArtifact + > + ): Promise< + [ + protos.google.cloud.apigeeregistry.v1.IArtifact[], + protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListArtifactsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listArtifacts(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 artifacts. + * Format: `{parent}` + * @param {number} request.pageSize + * The maximum number of artifacts to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListArtifacts` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListArtifacts` must + * match the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields except contents. + * @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.apigeeregistry.v1.Artifact|Artifact} 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 `listArtifactsAsync()` + * 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. + */ + listArtifactsStream( + request?: protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, + 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['listArtifacts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listArtifacts.createStream( + this.innerApiCalls.listArtifacts as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listArtifacts`, 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 artifacts. + * Format: `{parent}` + * @param {number} request.pageSize + * The maximum number of artifacts to return. + * The service may return fewer than this value. + * If unspecified, at most 50 values will be returned. + * The maximum is 1000; values above 1000 will be coerced to 1000. + * @param {string} request.pageToken + * A page token, received from a previous `ListArtifacts` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListArtifacts` must + * match the call that provided the page token. + * @param {string} request.filter + * An expression that can be used to filter the list. Filters use the Common + * Expression Language and can refer to all message fields except contents. + * @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.apigeeregistry.v1.Artifact|Artifact}. 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/registry.list_artifacts.js + * region_tag:apigeeregistry_v1_generated_Registry_ListArtifacts_async + */ + listArtifactsAsync( + request?: protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, + 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['listArtifacts']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listArtifacts.asyncIterate( + this.innerApiCalls['listArtifacts'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- 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 apiDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} deployment + * @returns {string} Resource name string. + */ + apiDeploymentPath( + project: string, + location: string, + api: string, + deployment: string + ) { + return this.pathTemplates.apiDeploymentPathTemplate.render({ + project: project, + location: location, + api: api, + deployment: deployment, + }); + } + + /** + * Parse the project from ApiDeployment resource. + * + * @param {string} apiDeploymentName + * A fully-qualified path representing ApiDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiDeploymentName(apiDeploymentName: string) { + return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName) + .project; + } + + /** + * Parse the location from ApiDeployment resource. + * + * @param {string} apiDeploymentName + * A fully-qualified path representing ApiDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiDeploymentName(apiDeploymentName: string) { + return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName) + .location; + } + + /** + * Parse the api from ApiDeployment resource. + * + * @param {string} apiDeploymentName + * A fully-qualified path representing ApiDeployment resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiDeploymentName(apiDeploymentName: string) { + return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName) + .api; + } + + /** + * Parse the deployment from ApiDeployment resource. + * + * @param {string} apiDeploymentName + * A fully-qualified path representing ApiDeployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromApiDeploymentName(apiDeploymentName: string) { + return this.pathTemplates.apiDeploymentPathTemplate.match(apiDeploymentName) + .deployment; + } + + /** + * Return a fully-qualified apiSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @returns {string} Resource name string. + */ + apiSpecPath( + project: string, + location: string, + api: string, + version: string, + spec: string + ) { + return this.pathTemplates.apiSpecPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + spec: spec, + }); + } + + /** + * Parse the project from ApiSpec resource. + * + * @param {string} apiSpecName + * A fully-qualified path representing ApiSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiSpecName(apiSpecName: string) { + return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).project; + } + + /** + * Parse the location from ApiSpec resource. + * + * @param {string} apiSpecName + * A fully-qualified path representing ApiSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiSpecName(apiSpecName: string) { + return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).location; + } + + /** + * Parse the api from ApiSpec resource. + * + * @param {string} apiSpecName + * A fully-qualified path representing ApiSpec resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiSpecName(apiSpecName: string) { + return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).api; + } + + /** + * Parse the version from ApiSpec resource. + * + * @param {string} apiSpecName + * A fully-qualified path representing ApiSpec resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiSpecName(apiSpecName: string) { + return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).version; + } + + /** + * Parse the spec from ApiSpec resource. + * + * @param {string} apiSpecName + * A fully-qualified path representing ApiSpec resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromApiSpecName(apiSpecName: string) { + return this.pathTemplates.apiSpecPathTemplate.match(apiSpecName).spec; + } + + /** + * Return a fully-qualified apiVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @returns {string} Resource name string. + */ + apiVersionPath( + project: string, + location: string, + api: string, + version: string + ) { + return this.pathTemplates.apiVersionPathTemplate.render({ + project: project, + location: location, + api: api, + version: version, + }); + } + + /** + * Parse the project from ApiVersion resource. + * + * @param {string} apiVersionName + * A fully-qualified path representing ApiVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromApiVersionName(apiVersionName: string) { + return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName) + .project; + } + + /** + * Parse the location from ApiVersion resource. + * + * @param {string} apiVersionName + * A fully-qualified path representing ApiVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromApiVersionName(apiVersionName: string) { + return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName) + .location; + } + + /** + * Parse the api from ApiVersion resource. + * + * @param {string} apiVersionName + * A fully-qualified path representing ApiVersion resource. + * @returns {string} A string representing the api. + */ + matchApiFromApiVersionName(apiVersionName: string) { + return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName).api; + } + + /** + * Parse the version from ApiVersion resource. + * + * @param {string} apiVersionName + * A fully-qualified path representing ApiVersion resource. + * @returns {string} A string representing the version. + */ + matchVersionFromApiVersionName(apiVersionName: string) { + return this.pathTemplates.apiVersionPathTemplate.match(apiVersionName) + .version; + } + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project: string, location: string, instance: string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * 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 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 projectLocationApiArtifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} artifact + * @returns {string} Resource name string. + */ + projectLocationApiArtifactPath( + project: string, + location: string, + api: string, + artifact: string + ) { + return this.pathTemplates.projectLocationApiArtifactPathTemplate.render({ + project: project, + location: location, + api: api, + artifact: artifact, + }); + } + + /** + * Parse the project from ProjectLocationApiArtifact resource. + * + * @param {string} projectLocationApiArtifactName + * A fully-qualified path representing project_location_api_artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationApiArtifactName( + projectLocationApiArtifactName: string + ) { + return this.pathTemplates.projectLocationApiArtifactPathTemplate.match( + projectLocationApiArtifactName + ).project; + } + + /** + * Parse the location from ProjectLocationApiArtifact resource. + * + * @param {string} projectLocationApiArtifactName + * A fully-qualified path representing project_location_api_artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationApiArtifactName( + projectLocationApiArtifactName: string + ) { + return this.pathTemplates.projectLocationApiArtifactPathTemplate.match( + projectLocationApiArtifactName + ).location; + } + + /** + * Parse the api from ProjectLocationApiArtifact resource. + * + * @param {string} projectLocationApiArtifactName + * A fully-qualified path representing project_location_api_artifact resource. + * @returns {string} A string representing the api. + */ + matchApiFromProjectLocationApiArtifactName( + projectLocationApiArtifactName: string + ) { + return this.pathTemplates.projectLocationApiArtifactPathTemplate.match( + projectLocationApiArtifactName + ).api; + } + + /** + * Parse the artifact from ProjectLocationApiArtifact resource. + * + * @param {string} projectLocationApiArtifactName + * A fully-qualified path representing project_location_api_artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromProjectLocationApiArtifactName( + projectLocationApiArtifactName: string + ) { + return this.pathTemplates.projectLocationApiArtifactPathTemplate.match( + projectLocationApiArtifactName + ).artifact; + } + + /** + * Return a fully-qualified projectLocationApiDeploymentArtifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} deployment + * @param {string} artifact + * @returns {string} Resource name string. + */ + projectLocationApiDeploymentArtifactPath( + project: string, + location: string, + api: string, + deployment: string, + artifact: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.render( + { + project: project, + location: location, + api: api, + deployment: deployment, + artifact: artifact, + } + ); + } + + /** + * Parse the project from ProjectLocationApiDeploymentArtifact resource. + * + * @param {string} projectLocationApiDeploymentArtifactName + * A fully-qualified path representing project_location_api_deployment_artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationApiDeploymentArtifactName( + projectLocationApiDeploymentArtifactName: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match( + projectLocationApiDeploymentArtifactName + ).project; + } + + /** + * Parse the location from ProjectLocationApiDeploymentArtifact resource. + * + * @param {string} projectLocationApiDeploymentArtifactName + * A fully-qualified path representing project_location_api_deployment_artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationApiDeploymentArtifactName( + projectLocationApiDeploymentArtifactName: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match( + projectLocationApiDeploymentArtifactName + ).location; + } + + /** + * Parse the api from ProjectLocationApiDeploymentArtifact resource. + * + * @param {string} projectLocationApiDeploymentArtifactName + * A fully-qualified path representing project_location_api_deployment_artifact resource. + * @returns {string} A string representing the api. + */ + matchApiFromProjectLocationApiDeploymentArtifactName( + projectLocationApiDeploymentArtifactName: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match( + projectLocationApiDeploymentArtifactName + ).api; + } + + /** + * Parse the deployment from ProjectLocationApiDeploymentArtifact resource. + * + * @param {string} projectLocationApiDeploymentArtifactName + * A fully-qualified path representing project_location_api_deployment_artifact resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromProjectLocationApiDeploymentArtifactName( + projectLocationApiDeploymentArtifactName: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match( + projectLocationApiDeploymentArtifactName + ).deployment; + } + + /** + * Parse the artifact from ProjectLocationApiDeploymentArtifact resource. + * + * @param {string} projectLocationApiDeploymentArtifactName + * A fully-qualified path representing project_location_api_deployment_artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromProjectLocationApiDeploymentArtifactName( + projectLocationApiDeploymentArtifactName: string + ) { + return this.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match( + projectLocationApiDeploymentArtifactName + ).artifact; + } + + /** + * Return a fully-qualified projectLocationApiVersionArtifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} artifact + * @returns {string} Resource name string. + */ + projectLocationApiVersionArtifactPath( + project: string, + location: string, + api: string, + version: string, + artifact: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.render( + { + project: project, + location: location, + api: api, + version: version, + artifact: artifact, + } + ); + } + + /** + * Parse the project from ProjectLocationApiVersionArtifact resource. + * + * @param {string} projectLocationApiVersionArtifactName + * A fully-qualified path representing project_location_api_version_artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationApiVersionArtifactName( + projectLocationApiVersionArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match( + projectLocationApiVersionArtifactName + ).project; + } + + /** + * Parse the location from ProjectLocationApiVersionArtifact resource. + * + * @param {string} projectLocationApiVersionArtifactName + * A fully-qualified path representing project_location_api_version_artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationApiVersionArtifactName( + projectLocationApiVersionArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match( + projectLocationApiVersionArtifactName + ).location; + } + + /** + * Parse the api from ProjectLocationApiVersionArtifact resource. + * + * @param {string} projectLocationApiVersionArtifactName + * A fully-qualified path representing project_location_api_version_artifact resource. + * @returns {string} A string representing the api. + */ + matchApiFromProjectLocationApiVersionArtifactName( + projectLocationApiVersionArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match( + projectLocationApiVersionArtifactName + ).api; + } + + /** + * Parse the version from ProjectLocationApiVersionArtifact resource. + * + * @param {string} projectLocationApiVersionArtifactName + * A fully-qualified path representing project_location_api_version_artifact resource. + * @returns {string} A string representing the version. + */ + matchVersionFromProjectLocationApiVersionArtifactName( + projectLocationApiVersionArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match( + projectLocationApiVersionArtifactName + ).version; + } + + /** + * Parse the artifact from ProjectLocationApiVersionArtifact resource. + * + * @param {string} projectLocationApiVersionArtifactName + * A fully-qualified path representing project_location_api_version_artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromProjectLocationApiVersionArtifactName( + projectLocationApiVersionArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match( + projectLocationApiVersionArtifactName + ).artifact; + } + + /** + * Return a fully-qualified projectLocationApiVersionSpecArtifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} api + * @param {string} version + * @param {string} spec + * @param {string} artifact + * @returns {string} Resource name string. + */ + projectLocationApiVersionSpecArtifactPath( + project: string, + location: string, + api: string, + version: string, + spec: string, + artifact: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.render( + { + project: project, + location: location, + api: api, + version: version, + spec: spec, + artifact: artifact, + } + ); + } + + /** + * Parse the project from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).project; + } + + /** + * Parse the location from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).location; + } + + /** + * Parse the api from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the api. + */ + matchApiFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).api; + } + + /** + * Parse the version from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the version. + */ + matchVersionFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).version; + } + + /** + * Parse the spec from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the spec. + */ + matchSpecFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).spec; + } + + /** + * Parse the artifact from ProjectLocationApiVersionSpecArtifact resource. + * + * @param {string} projectLocationApiVersionSpecArtifactName + * A fully-qualified path representing project_location_api_version_spec_artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromProjectLocationApiVersionSpecArtifactName( + projectLocationApiVersionSpecArtifactName: string + ) { + return this.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match( + projectLocationApiVersionSpecArtifactName + ).artifact; + } + + /** + * Return a fully-qualified projectLocationArtifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} artifact + * @returns {string} Resource name string. + */ + projectLocationArtifactPath( + project: string, + location: string, + artifact: string + ) { + return this.pathTemplates.projectLocationArtifactPathTemplate.render({ + project: project, + location: location, + artifact: artifact, + }); + } + + /** + * Parse the project from ProjectLocationArtifact resource. + * + * @param {string} projectLocationArtifactName + * A fully-qualified path representing project_location_artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationArtifactName( + projectLocationArtifactName: string + ) { + return this.pathTemplates.projectLocationArtifactPathTemplate.match( + projectLocationArtifactName + ).project; + } + + /** + * Parse the location from ProjectLocationArtifact resource. + * + * @param {string} projectLocationArtifactName + * A fully-qualified path representing project_location_artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationArtifactName( + projectLocationArtifactName: string + ) { + return this.pathTemplates.projectLocationArtifactPathTemplate.match( + projectLocationArtifactName + ).location; + } + + /** + * Parse the artifact from ProjectLocationArtifact resource. + * + * @param {string} projectLocationArtifactName + * A fully-qualified path representing project_location_artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromProjectLocationArtifactName( + projectLocationArtifactName: string + ) { + return this.pathTemplates.projectLocationArtifactPathTemplate.match( + projectLocationArtifactName + ).artifact; + } + + /** + * 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.registryStub && !this._terminated) { + return this.registryStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-apigeeregistry/src/v1/registry_client_config.json b/packages/google-cloud-apigeeregistry/src/v1/registry_client_config.json new file mode 100644 index 00000000000..c26bf956bc9 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/src/v1/registry_client_config.json @@ -0,0 +1,216 @@ +{ + "interfaces": { + "google.cloud.apigeeregistry.v1.Registry": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "cancelled_deadline_exceeded_aborted_unavailable": [ + "CANCELLED", + "DEADLINE_EXCEEDED", + "ABORTED", + "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 + }, + "5763d5cb4f40f09b4de469b8a0f10443a7a49d00": { + "initial_retry_delay_millis": 200, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListApis": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "GetApi": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "CreateApi": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "UpdateApi": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "DeleteApi": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "ListApiVersions": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "GetApiVersion": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "CreateApiVersion": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "UpdateApiVersion": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "DeleteApiVersion": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "ListApiSpecs": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "GetApiSpec": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "GetApiSpecContents": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "CreateApiSpec": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "UpdateApiSpec": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "DeleteApiSpec": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "TagApiSpecRevision": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "ListApiSpecRevisions": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "RollbackApiSpec": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteApiSpecRevision": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "ListApiDeployments": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "GetApiDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "CreateApiDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "UpdateApiDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "DeleteApiDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "TagApiDeploymentRevision": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "ListApiDeploymentRevisions": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "RollbackApiDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteApiDeploymentRevision": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "ListArtifacts": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "GetArtifact": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "GetArtifactContents": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "CreateArtifact": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "ReplaceArtifact": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + }, + "DeleteArtifact": { + "timeout_millis": 60000, + "retry_codes_name": "cancelled_deadline_exceeded_aborted_unavailable", + "retry_params_name": "5763d5cb4f40f09b4de469b8a0f10443a7a49d00" + } + } + } + } +} diff --git a/packages/google-cloud-apigeeregistry/src/v1/registry_proto_list.json b/packages/google-cloud-apigeeregistry/src/v1/registry_proto_list.json new file mode 100644 index 00000000000..4fdc846ee2b --- /dev/null +++ b/packages/google-cloud-apigeeregistry/src/v1/registry_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/cloud/apigeeregistry/v1/provisioning_service.proto", + "../../protos/google/cloud/apigeeregistry/v1/registry_models.proto", + "../../protos/google/cloud/apigeeregistry/v1/registry_service.proto" +] diff --git a/packages/google-cloud-apigeeregistry/system-test/fixtures/sample/src/index.js b/packages/google-cloud-apigeeregistry/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..113a4716508 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by 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 apigeeregistry = require('@google-cloud/apigee-registry'); + +function main() { + const provisioningClient = new apigeeregistry.ProvisioningClient(); + const registryClient = new apigeeregistry.RegistryClient(); +} + +main(); diff --git a/packages/google-cloud-apigeeregistry/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-apigeeregistry/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..9a94f4bec58 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,41 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import { + ProvisioningClient, + RegistryClient, +} from '@google-cloud/apigee-registry'; + +// check that the client class type name can be used +function doStuffWithProvisioningClient(client: ProvisioningClient) { + client.close(); +} +function doStuffWithRegistryClient(client: RegistryClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const provisioningClient = new ProvisioningClient(); + doStuffWithProvisioningClient(provisioningClient); + // check that the client instance can be created + const registryClient = new RegistryClient(); + doStuffWithRegistryClient(registryClient); +} + +main(); diff --git a/packages/google-cloud-apigeeregistry/system-test/install.ts b/packages/google-cloud-apigeeregistry/system-test/install.ts new file mode 100644 index 00000000000..f61fe236476 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); + }); + + it('JavaScript code', async function () { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); + }); +}); diff --git a/packages/google-cloud-apigeeregistry/test/gapic_provisioning_v1.ts b/packages/google-cloud-apigeeregistry/test/gapic_provisioning_v1.ts new file mode 100644 index 00000000000..50e41b6b3e9 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/test/gapic_provisioning_v1.ts @@ -0,0 +1,2547 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as provisioningModule from '../src'; + +import { + protobuf, + LROperation, + operationsProtos, + IamProtos, + LocationProtos, +} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function 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 servicePath', () => { + const servicePath = provisioningModule.v1.ProvisioningClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = provisioningModule.v1.ProvisioningClient.apiEndpoint; + assert(apiEndpoint); + }); + + 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('getInstance', () => { + it('invokes getInstance 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.apigeeregistry.v1.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Instance() + ); + client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); + const [response] = await client.getInstance(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance 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.apigeeregistry.v1.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Instance() + ); + client.innerApiCalls.getInstance = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IInstance | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance 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.apigeeregistry.v1.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstance = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInstance 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.apigeeregistry.v1.GetInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getInstance(request), expectedError); + }); + }); + + describe('createInstance', () => { + it('invokes createInstance 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.apigeeregistry.v1.CreateInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance 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.apigeeregistry.v1.CreateInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance 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.apigeeregistry.v1.CreateInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInstance 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.apigeeregistry.v1.CreateInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateInstanceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateInstanceProgress 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.checkCreateInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInstanceProgress 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.checkCreateInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance 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.apigeeregistry.v1.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance 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.apigeeregistry.v1.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance 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.apigeeregistry.v1.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteInstance(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInstance 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.apigeeregistry.v1.DeleteInstanceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteInstanceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteInstance(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteInstanceProgress 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.checkDeleteInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteInstanceProgress 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.checkDeleteInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new 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('apiDeployment', () => { + const fakePath = '/rendered/path/apiDeployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + deployment: 'deploymentValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiDeploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiDeploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiDeploymentPath', () => { + const result = client.apiDeploymentPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiDeploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiDeploymentName', () => { + const result = client.matchProjectFromApiDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiDeploymentName', () => { + const result = client.matchLocationFromApiDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiDeploymentName', () => { + const result = client.matchApiFromApiDeploymentName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromApiDeploymentName', () => { + const result = client.matchDeploymentFromApiDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiSpec', () => { + const fakePath = '/rendered/path/apiSpec'; + 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.apiSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiSpecPath', () => { + const result = client.apiSpecPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'specValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiSpecName', () => { + const result = client.matchProjectFromApiSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiSpecName', () => { + const result = client.matchLocationFromApiSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiSpecName', () => { + const result = client.matchApiFromApiSpecName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromApiSpecName', () => { + const result = client.matchVersionFromApiSpecName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.apiSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecFromApiSpecName', () => { + const result = client.matchSpecFromApiSpecName(fakePath); + assert.strictEqual(result, 'specValue'); + assert( + (client.pathTemplates.apiSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiVersion', () => { + const fakePath = '/rendered/path/apiVersion'; + 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.apiVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiVersionPath', () => { + const result = client.apiVersionPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiVersionName', () => { + const result = client.matchProjectFromApiVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiVersionName', () => { + const result = client.matchLocationFromApiVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiVersionName', () => { + const result = client.matchApiFromApiVersionName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromApiVersionName', () => { + const result = client.matchVersionFromApiVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.apiVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('instance', () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath( + 'projectValue', + 'locationValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.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('projectLocationApiArtifact', () => { + const fakePath = '/rendered/path/projectLocationApiArtifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + artifact: 'artifactValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationApiArtifactPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationApiArtifactPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationApiArtifactPath', () => { + const result = client.projectLocationApiArtifactPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationApiArtifactPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationApiArtifactName', () => { + const result = + client.matchProjectFromProjectLocationApiArtifactName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationApiArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationApiArtifactName', () => { + const result = + client.matchLocationFromProjectLocationApiArtifactName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationApiArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromProjectLocationApiArtifactName', () => { + const result = + client.matchApiFromProjectLocationApiArtifactName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + ( + client.pathTemplates.projectLocationApiArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromProjectLocationApiArtifactName', () => { + const result = + client.matchArtifactFromProjectLocationApiArtifactName(fakePath); + assert.strictEqual(result, 'artifactValue'); + assert( + ( + client.pathTemplates.projectLocationApiArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationApiDeploymentArtifact', () => { + const fakePath = '/rendered/path/projectLocationApiDeploymentArtifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + deployment: 'deploymentValue', + artifact: 'artifactValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationApiDeploymentArtifactPath', () => { + const result = client.projectLocationApiDeploymentArtifactPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'deploymentValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationApiDeploymentArtifactName', () => { + const result = + client.matchProjectFromProjectLocationApiDeploymentArtifactName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationApiDeploymentArtifactName', () => { + const result = + client.matchLocationFromProjectLocationApiDeploymentArtifactName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromProjectLocationApiDeploymentArtifactName', () => { + const result = + client.matchApiFromProjectLocationApiDeploymentArtifactName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromProjectLocationApiDeploymentArtifactName', () => { + const result = + client.matchDeploymentFromProjectLocationApiDeploymentArtifactName( + fakePath + ); + assert.strictEqual(result, 'deploymentValue'); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromProjectLocationApiDeploymentArtifactName', () => { + const result = + client.matchArtifactFromProjectLocationApiDeploymentArtifactName( + fakePath + ); + assert.strictEqual(result, 'artifactValue'); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationApiVersionArtifact', () => { + const fakePath = '/rendered/path/projectLocationApiVersionArtifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + artifact: 'artifactValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationApiVersionArtifactPath', () => { + const result = client.projectLocationApiVersionArtifactPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationApiVersionArtifactName', () => { + const result = + client.matchProjectFromProjectLocationApiVersionArtifactName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationApiVersionArtifactName', () => { + const result = + client.matchLocationFromProjectLocationApiVersionArtifactName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromProjectLocationApiVersionArtifactName', () => { + const result = + client.matchApiFromProjectLocationApiVersionArtifactName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromProjectLocationApiVersionArtifactName', () => { + const result = + client.matchVersionFromProjectLocationApiVersionArtifactName( + fakePath + ); + assert.strictEqual(result, 'versionValue'); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromProjectLocationApiVersionArtifactName', () => { + const result = + client.matchArtifactFromProjectLocationApiVersionArtifactName( + fakePath + ); + assert.strictEqual(result, 'artifactValue'); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationApiVersionSpecArtifact', () => { + const fakePath = '/rendered/path/projectLocationApiVersionSpecArtifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + spec: 'specValue', + artifact: 'artifactValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationApiVersionSpecArtifactPath', () => { + const result = client.projectLocationApiVersionSpecArtifactPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'specValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchProjectFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchLocationFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchApiFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'apiValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchVersionFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'versionValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchSpecFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'specValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchArtifactFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'artifactValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationArtifact', () => { + const fakePath = '/rendered/path/projectLocationArtifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + artifact: 'artifactValue', + }; + const client = new provisioningModule.v1.ProvisioningClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationArtifactPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationArtifactPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationArtifactPath', () => { + const result = client.projectLocationArtifactPath( + 'projectValue', + 'locationValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationArtifactPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationArtifactName', () => { + const result = + client.matchProjectFromProjectLocationArtifactName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationArtifactName', () => { + const result = + client.matchLocationFromProjectLocationArtifactName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromProjectLocationArtifactName', () => { + const result = + client.matchArtifactFromProjectLocationArtifactName(fakePath); + assert.strictEqual(result, 'artifactValue'); + assert( + ( + client.pathTemplates.projectLocationArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-apigeeregistry/test/gapic_registry_v1.ts b/packages/google-cloud-apigeeregistry/test/gapic_registry_v1.ts new file mode 100644 index 00000000000..ab87ec86793 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/test/gapic_registry_v1.ts @@ -0,0 +1,7733 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as registryModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function 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.RegistryClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = registryModule.v1.RegistryClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = registryModule.v1.RegistryClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = registryModule.v1.RegistryClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new registryModule.v1.RegistryClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new registryModule.v1.RegistryClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.registryStub, undefined); + await client.initialize(); + assert(client.registryStub); + }); + + it('has close method for the initialized client', done => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.registryStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.registryStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new registryModule.v1.RegistryClient({ + 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 registryModule.v1.RegistryClient({ + 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('getApi', () => { + it('invokes getApi without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Api() + ); + client.innerApiCalls.getApi = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApi( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.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('createApi', () => { + it('invokes createApi without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Api() + ); + client.innerApiCalls.createApi = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createApi( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.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('updateApi', () => { + it('invokes updateApi without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiRequest() + ); + request.api ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiRequest', + ['api', 'name'] + ); + request.api.name = defaultValue1; + const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiRequest() + ); + request.api ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiRequest', + ['api', 'name'] + ); + request.api.name = defaultValue1; + const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Api() + ); + client.innerApiCalls.updateApi = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateApi( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiRequest() + ); + request.api ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiRequest() + ); + request.api ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.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('getApiVersion', () => { + it('invokes getApiVersion without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ); + client.innerApiCalls.getApiVersion = stubSimpleCall(expectedResponse); + const [response] = await client.getApiVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiVersion without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ); + client.innerApiCalls.getApiVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApiVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiVersion | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiVersion with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getApiVersion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getApiVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiVersion with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getApiVersion(request), expectedError); + }); + }); + + describe('createApiVersion', () => { + it('invokes createApiVersion without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiVersionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ); + client.innerApiCalls.createApiVersion = stubSimpleCall(expectedResponse); + const [response] = await client.createApiVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiVersion without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiVersionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ); + client.innerApiCalls.createApiVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createApiVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiVersion | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiVersion with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiVersionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApiVersion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createApiVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiVersion with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiVersionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createApiVersion(request), expectedError); + }); + }); + + describe('updateApiVersion', () => { + it('invokes updateApiVersion without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest() + ); + request.apiVersion ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest', + ['apiVersion', 'name'] + ); + request.apiVersion.name = defaultValue1; + const expectedHeaderRequestParams = `api_version.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ); + client.innerApiCalls.updateApiVersion = stubSimpleCall(expectedResponse); + const [response] = await client.updateApiVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApiVersion without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest() + ); + request.apiVersion ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest', + ['apiVersion', 'name'] + ); + request.apiVersion.name = defaultValue1; + const expectedHeaderRequestParams = `api_version.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ); + client.innerApiCalls.updateApiVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateApiVersion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiVersion | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApiVersion with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest() + ); + request.apiVersion ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest', + ['apiVersion', 'name'] + ); + request.apiVersion.name = defaultValue1; + const expectedHeaderRequestParams = `api_version.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateApiVersion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateApiVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApiVersion with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest() + ); + request.apiVersion ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiVersionRequest', + ['apiVersion', 'name'] + ); + request.apiVersion.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateApiVersion(request), expectedError); + }); + }); + + describe('deleteApiVersion', () => { + it('invokes deleteApiVersion without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteApiVersion = stubSimpleCall(expectedResponse); + const [response] = await client.deleteApiVersion(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiVersion without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteApiVersion = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteApiVersion( + 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.deleteApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiVersion with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteApiVersion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteApiVersion(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteApiVersion as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiVersion as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiVersion with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiVersionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteApiVersion(request), expectedError); + }); + }); + + describe('getApiSpec', () => { + it('invokes getApiSpec without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.getApiSpec = stubSimpleCall(expectedResponse); + const [response] = await client.getApiSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiSpec without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.getApiSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApiSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiSpec with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getApiSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getApiSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiSpec with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getApiSpec(request), expectedError); + }); + }); + + describe('getApiSpecContents', () => { + it('invokes getApiSpecContents without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.getApiSpecContents = + stubSimpleCall(expectedResponse); + const [response] = await client.getApiSpecContents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApiSpecContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiSpecContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiSpecContents without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.getApiSpecContents = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApiSpecContents( + request, + (err?: Error | null, result?: protos.google.api.IHttpBody | null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApiSpecContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiSpecContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiSpecContents with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getApiSpecContents = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getApiSpecContents(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getApiSpecContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiSpecContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiSpecContents with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiSpecContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getApiSpecContents(request), expectedError); + }); + }); + + describe('createApiSpec', () => { + it('invokes createApiSpec without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiSpecRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.createApiSpec = stubSimpleCall(expectedResponse); + const [response] = await client.createApiSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiSpec without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiSpecRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.createApiSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createApiSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiSpec with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiSpecRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApiSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createApiSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiSpec with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiSpecRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createApiSpec(request), expectedError); + }); + }); + + describe('updateApiSpec', () => { + it('invokes updateApiSpec without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest() + ); + request.apiSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest', + ['apiSpec', 'name'] + ); + request.apiSpec.name = defaultValue1; + const expectedHeaderRequestParams = `api_spec.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.updateApiSpec = stubSimpleCall(expectedResponse); + const [response] = await client.updateApiSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApiSpec without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest() + ); + request.apiSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest', + ['apiSpec', 'name'] + ); + request.apiSpec.name = defaultValue1; + const expectedHeaderRequestParams = `api_spec.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.updateApiSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateApiSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApiSpec with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest() + ); + request.apiSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest', + ['apiSpec', 'name'] + ); + request.apiSpec.name = defaultValue1; + const expectedHeaderRequestParams = `api_spec.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateApiSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateApiSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApiSpec with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest() + ); + request.apiSpec ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiSpecRequest', + ['apiSpec', 'name'] + ); + request.apiSpec.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateApiSpec(request), expectedError); + }); + }); + + describe('deleteApiSpec', () => { + it('invokes deleteApiSpec without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteApiSpec = stubSimpleCall(expectedResponse); + const [response] = await client.deleteApiSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiSpec without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteApiSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteApiSpec( + 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.deleteApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiSpec with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteApiSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteApiSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiSpec with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteApiSpec(request), expectedError); + }); + }); + + describe('tagApiSpecRevision', () => { + it('invokes tagApiSpecRevision without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.tagApiSpecRevision = + stubSimpleCall(expectedResponse); + const [response] = await client.tagApiSpecRevision(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.tagApiSpecRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.tagApiSpecRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes tagApiSpecRevision without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.tagApiSpecRevision = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.tagApiSpecRevision( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.tagApiSpecRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.tagApiSpecRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes tagApiSpecRevision with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.tagApiSpecRevision = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.tagApiSpecRevision(request), expectedError); + const actualRequest = ( + client.innerApiCalls.tagApiSpecRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.tagApiSpecRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes tagApiSpecRevision with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.TagApiSpecRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.tagApiSpecRevision(request), expectedError); + }); + }); + + describe('rollbackApiSpec', () => { + it('invokes rollbackApiSpec without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.rollbackApiSpec = stubSimpleCall(expectedResponse); + const [response] = await client.rollbackApiSpec(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.rollbackApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rollbackApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackApiSpec without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.rollbackApiSpec = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rollbackApiSpec( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.rollbackApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rollbackApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackApiSpec with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rollbackApiSpec = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.rollbackApiSpec(request), expectedError); + const actualRequest = ( + client.innerApiCalls.rollbackApiSpec as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rollbackApiSpec as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackApiSpec with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.RollbackApiSpecRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.rollbackApiSpec(request), expectedError); + }); + }); + + describe('deleteApiSpecRevision', () => { + it('invokes deleteApiSpecRevision without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.deleteApiSpecRevision = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteApiSpecRevision(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteApiSpecRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiSpecRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiSpecRevision without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ); + client.innerApiCalls.deleteApiSpecRevision = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteApiSpecRevision( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiSpec | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteApiSpecRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiSpecRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiSpecRevision with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteApiSpecRevision = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteApiSpecRevision(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteApiSpecRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiSpecRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiSpecRevision with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiSpecRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.deleteApiSpecRevision(request), + expectedError + ); + }); + }); + + describe('getApiDeployment', () => { + it('invokes getApiDeployment without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.getApiDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.getApiDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiDeployment without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.getApiDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getApiDeployment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiDeployment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiDeployment with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getApiDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getApiDeployment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getApiDeployment with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getApiDeployment(request), expectedError); + }); + }); + + describe('createApiDeployment', () => { + it('invokes createApiDeployment without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.createApiDeployment = + stubSimpleCall(expectedResponse); + const [response] = await client.createApiDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiDeployment without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.createApiDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createApiDeployment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiDeployment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiDeployment with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createApiDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createApiDeployment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createApiDeployment with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateApiDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createApiDeployment(request), expectedError); + }); + }); + + describe('updateApiDeployment', () => { + it('invokes updateApiDeployment without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest() + ); + request.apiDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest', + ['apiDeployment', 'name'] + ); + request.apiDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `api_deployment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.updateApiDeployment = + stubSimpleCall(expectedResponse); + const [response] = await client.updateApiDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApiDeployment without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest() + ); + request.apiDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest', + ['apiDeployment', 'name'] + ); + request.apiDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `api_deployment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.updateApiDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateApiDeployment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiDeployment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApiDeployment with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest() + ); + request.apiDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest', + ['apiDeployment', 'name'] + ); + request.apiDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `api_deployment.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateApiDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateApiDeployment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateApiDeployment with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest() + ); + request.apiDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.UpdateApiDeploymentRequest', + ['apiDeployment', 'name'] + ); + request.apiDeployment.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateApiDeployment(request), expectedError); + }); + }); + + describe('deleteApiDeployment', () => { + it('invokes deleteApiDeployment without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteApiDeployment = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteApiDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiDeployment without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteApiDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteApiDeployment( + 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.deleteApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiDeployment with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteApiDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteApiDeployment(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiDeployment with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteApiDeployment(request), expectedError); + }); + }); + + describe('tagApiDeploymentRevision', () => { + it('invokes tagApiDeploymentRevision without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.tagApiDeploymentRevision = + stubSimpleCall(expectedResponse); + const [response] = await client.tagApiDeploymentRevision(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.tagApiDeploymentRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.tagApiDeploymentRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes tagApiDeploymentRevision without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.tagApiDeploymentRevision = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.tagApiDeploymentRevision( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiDeployment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.tagApiDeploymentRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.tagApiDeploymentRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes tagApiDeploymentRevision with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.tagApiDeploymentRevision = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.tagApiDeploymentRevision(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.tagApiDeploymentRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.tagApiDeploymentRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes tagApiDeploymentRevision with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.TagApiDeploymentRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.tagApiDeploymentRevision(request), + expectedError + ); + }); + }); + + describe('rollbackApiDeployment', () => { + it('invokes rollbackApiDeployment without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.rollbackApiDeployment = + stubSimpleCall(expectedResponse); + const [response] = await client.rollbackApiDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.rollbackApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rollbackApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackApiDeployment without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.rollbackApiDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rollbackApiDeployment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiDeployment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.rollbackApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rollbackApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackApiDeployment with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rollbackApiDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.rollbackApiDeployment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.rollbackApiDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rollbackApiDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rollbackApiDeployment with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.RollbackApiDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.rollbackApiDeployment(request), + expectedError + ); + }); + }); + + describe('deleteApiDeploymentRevision', () => { + it('invokes deleteApiDeploymentRevision without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.deleteApiDeploymentRevision = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteApiDeploymentRevision(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteApiDeploymentRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiDeploymentRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiDeploymentRevision without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ); + client.innerApiCalls.deleteApiDeploymentRevision = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteApiDeploymentRevision( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiDeployment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteApiDeploymentRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiDeploymentRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiDeploymentRevision with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteApiDeploymentRevision = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteApiDeploymentRevision(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteApiDeploymentRevision as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteApiDeploymentRevision as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteApiDeploymentRevision with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteApiDeploymentRevisionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.deleteApiDeploymentRevision(request), + expectedError + ); + }); + }); + + describe('getArtifact', () => { + it('invokes getArtifact without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetArtifactRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ); + client.innerApiCalls.getArtifact = stubSimpleCall(expectedResponse); + const [response] = await client.getArtifact(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getArtifact without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetArtifactRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ); + client.innerApiCalls.getArtifact = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getArtifact( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IArtifact | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getArtifact with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetArtifactRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getArtifact = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getArtifact(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getArtifact with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetArtifactRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getArtifact(request), expectedError); + }); + }); + + describe('getArtifactContents', () => { + it('invokes getArtifactContents without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.getArtifactContents = + stubSimpleCall(expectedResponse); + const [response] = await client.getArtifactContents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getArtifactContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getArtifactContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getArtifactContents without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.getArtifactContents = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getArtifactContents( + request, + (err?: Error | null, result?: protos.google.api.IHttpBody | null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getArtifactContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getArtifactContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getArtifactContents with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getArtifactContents = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getArtifactContents(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getArtifactContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getArtifactContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getArtifactContents with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.GetArtifactContentsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getArtifactContents(request), expectedError); + }); + }); + + describe('createArtifact', () => { + it('invokes createArtifact without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateArtifactRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ); + client.innerApiCalls.createArtifact = stubSimpleCall(expectedResponse); + const [response] = await client.createArtifact(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createArtifact without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateArtifactRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ); + client.innerApiCalls.createArtifact = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createArtifact( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IArtifact | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createArtifact with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateArtifactRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createArtifact = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createArtifact(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createArtifact with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.CreateArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.CreateArtifactRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createArtifact(request), expectedError); + }); + }); + + describe('replaceArtifact', () => { + it('invokes replaceArtifact without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest() + ); + request.artifact ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest', + ['artifact', 'name'] + ); + request.artifact.name = defaultValue1; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ); + client.innerApiCalls.replaceArtifact = stubSimpleCall(expectedResponse); + const [response] = await client.replaceArtifact(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.replaceArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.replaceArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes replaceArtifact without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest() + ); + request.artifact ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest', + ['artifact', 'name'] + ); + request.artifact.name = defaultValue1; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ); + client.innerApiCalls.replaceArtifact = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.replaceArtifact( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IArtifact | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.replaceArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.replaceArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes replaceArtifact with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest() + ); + request.artifact ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest', + ['artifact', 'name'] + ); + request.artifact.name = defaultValue1; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.replaceArtifact = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.replaceArtifact(request), expectedError); + const actualRequest = ( + client.innerApiCalls.replaceArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.replaceArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes replaceArtifact with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest() + ); + request.artifact ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ReplaceArtifactRequest', + ['artifact', 'name'] + ); + request.artifact.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.replaceArtifact(request), expectedError); + }); + }); + + describe('deleteArtifact', () => { + it('invokes deleteArtifact without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteArtifactRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteArtifact = stubSimpleCall(expectedResponse); + const [response] = await client.deleteArtifact(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteArtifact without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteArtifactRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteArtifact = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteArtifact( + 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.deleteArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteArtifact with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteArtifactRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteArtifact = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteArtifact(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteArtifact as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteArtifact with closed client', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.DeleteArtifactRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.DeleteArtifactRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteArtifact(request), expectedError); + }); + }); + + describe('listApis', () => { + it('invokes listApis without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), + generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), + generateSampleMessage(new protos.google.cloud.apigeeregistry.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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), + generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), + generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), + ]; + client.innerApiCalls.listApis = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listApis( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), + generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), + generateSampleMessage(new protos.google.cloud.apigeeregistry.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.apigeeregistry.v1.Api[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.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.apigeeregistry.v1.Api[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApisRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), + generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), + generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), + ]; + client.descriptors.page.listApis.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apigeeregistry.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 registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApisRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.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.apigeeregistry.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('listApiVersions', () => { + it('invokes listApiVersions without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + ]; + client.innerApiCalls.listApiVersions = stubSimpleCall(expectedResponse); + const [response] = await client.listApiVersions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApiVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiVersions without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + ]; + client.innerApiCalls.listApiVersions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listApiVersions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiVersion[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApiVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiVersions with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listApiVersions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listApiVersions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listApiVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiVersionsStream without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + ]; + client.descriptors.page.listApiVersions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listApiVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.ApiVersion[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.ApiVersion) => { + 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.listApiVersions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApiVersions, request) + ); + assert( + (client.descriptors.page.listApiVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listApiVersionsStream with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiVersions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listApiVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.ApiVersion[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.ApiVersion) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listApiVersions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApiVersions, request) + ); + assert( + (client.descriptors.page.listApiVersions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiVersions without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiVersion() + ), + ]; + client.descriptors.page.listApiVersions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apigeeregistry.v1.IApiVersion[] = []; + const iterable = client.listApiVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listApiVersions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listApiVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiVersions with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiVersionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiVersions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listApiVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apigeeregistry.v1.IApiVersion[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listApiVersions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listApiVersions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listApiSpecs', () => { + it('invokes listApiSpecs without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + ]; + client.innerApiCalls.listApiSpecs = stubSimpleCall(expectedResponse); + const [response] = await client.listApiSpecs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApiSpecs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiSpecs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiSpecs without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + ]; + client.innerApiCalls.listApiSpecs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listApiSpecs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiSpec[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApiSpecs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiSpecs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiSpecs with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listApiSpecs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listApiSpecs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listApiSpecs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiSpecs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiSpecsStream without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + ]; + client.descriptors.page.listApiSpecs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listApiSpecsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.ApiSpec[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.ApiSpec) => { + 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.listApiSpecs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApiSpecs, request) + ); + assert( + (client.descriptors.page.listApiSpecs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listApiSpecsStream with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiSpecs.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listApiSpecsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.ApiSpec[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.ApiSpec) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listApiSpecs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApiSpecs, request) + ); + assert( + (client.descriptors.page.listApiSpecs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiSpecs without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + ]; + client.descriptors.page.listApiSpecs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apigeeregistry.v1.IApiSpec[] = []; + const iterable = client.listApiSpecsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listApiSpecs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listApiSpecs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiSpecs with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiSpecs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listApiSpecsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apigeeregistry.v1.IApiSpec[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listApiSpecs.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listApiSpecs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listApiSpecRevisions', () => { + it('invokes listApiSpecRevisions without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + ]; + client.innerApiCalls.listApiSpecRevisions = + stubSimpleCall(expectedResponse); + const [response] = await client.listApiSpecRevisions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApiSpecRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiSpecRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiSpecRevisions without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + ]; + client.innerApiCalls.listApiSpecRevisions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listApiSpecRevisions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IApiSpec[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApiSpecRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiSpecRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiSpecRevisions with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listApiSpecRevisions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listApiSpecRevisions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listApiSpecRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiSpecRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiSpecRevisionsStream without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + ]; + client.descriptors.page.listApiSpecRevisions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listApiSpecRevisionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.ApiSpec[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.ApiSpec) => { + 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.listApiSpecRevisions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApiSpecRevisions, request) + ); + assert( + (client.descriptors.page.listApiSpecRevisions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listApiSpecRevisionsStream with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiSpecRevisions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listApiSpecRevisionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.ApiSpec[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.ApiSpec) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listApiSpecRevisions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApiSpecRevisions, request) + ); + assert( + (client.descriptors.page.listApiSpecRevisions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiSpecRevisions without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiSpec() + ), + ]; + client.descriptors.page.listApiSpecRevisions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apigeeregistry.v1.IApiSpec[] = []; + const iterable = client.listApiSpecRevisionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listApiSpecRevisions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listApiSpecRevisions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiSpecRevisions with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiSpecRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiSpecRevisions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listApiSpecRevisionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apigeeregistry.v1.IApiSpec[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listApiSpecRevisions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listApiSpecRevisions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listApiDeployments', () => { + it('invokes listApiDeployments without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + ]; + client.innerApiCalls.listApiDeployments = + stubSimpleCall(expectedResponse); + const [response] = await client.listApiDeployments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApiDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiDeployments without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + ]; + client.innerApiCalls.listApiDeployments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listApiDeployments( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.apigeeregistry.v1.IApiDeployment[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApiDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiDeployments with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listApiDeployments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listApiDeployments(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listApiDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiDeploymentsStream without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + ]; + client.descriptors.page.listApiDeployments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listApiDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.ApiDeployment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.ApiDeployment) => { + 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.listApiDeployments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApiDeployments, request) + ); + assert( + (client.descriptors.page.listApiDeployments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listApiDeploymentsStream with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiDeployments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listApiDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.ApiDeployment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.ApiDeployment) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listApiDeployments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listApiDeployments, request) + ); + assert( + (client.descriptors.page.listApiDeployments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiDeployments without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + ]; + client.descriptors.page.listApiDeployments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apigeeregistry.v1.IApiDeployment[] = + []; + const iterable = client.listApiDeploymentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listApiDeployments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listApiDeployments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiDeployments with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiDeployments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listApiDeploymentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apigeeregistry.v1.IApiDeployment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listApiDeployments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listApiDeployments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listApiDeploymentRevisions', () => { + it('invokes listApiDeploymentRevisions without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + ]; + client.innerApiCalls.listApiDeploymentRevisions = + stubSimpleCall(expectedResponse); + const [response] = await client.listApiDeploymentRevisions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApiDeploymentRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiDeploymentRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiDeploymentRevisions without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + ]; + client.innerApiCalls.listApiDeploymentRevisions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listApiDeploymentRevisions( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.apigeeregistry.v1.IApiDeployment[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listApiDeploymentRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiDeploymentRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiDeploymentRevisions with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listApiDeploymentRevisions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listApiDeploymentRevisions(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listApiDeploymentRevisions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listApiDeploymentRevisions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listApiDeploymentRevisionsStream without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + ]; + client.descriptors.page.listApiDeploymentRevisions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listApiDeploymentRevisionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.ApiDeployment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.ApiDeployment) => { + 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.listApiDeploymentRevisions + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listApiDeploymentRevisions, request) + ); + assert( + ( + client.descriptors.page.listApiDeploymentRevisions + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listApiDeploymentRevisionsStream with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiDeploymentRevisions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listApiDeploymentRevisionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.ApiDeployment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.ApiDeployment) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listApiDeploymentRevisions + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listApiDeploymentRevisions, request) + ); + assert( + ( + client.descriptors.page.listApiDeploymentRevisions + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiDeploymentRevisions without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ApiDeployment() + ), + ]; + client.descriptors.page.listApiDeploymentRevisions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apigeeregistry.v1.IApiDeployment[] = + []; + const iterable = client.listApiDeploymentRevisionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listApiDeploymentRevisions + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listApiDeploymentRevisions + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listApiDeploymentRevisions with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListApiDeploymentRevisionsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listApiDeploymentRevisions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listApiDeploymentRevisionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apigeeregistry.v1.IApiDeployment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listApiDeploymentRevisions + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listApiDeploymentRevisions + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listArtifacts', () => { + it('invokes listArtifacts without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListArtifactsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListArtifactsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + ]; + client.innerApiCalls.listArtifacts = stubSimpleCall(expectedResponse); + const [response] = await client.listArtifacts(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listArtifacts without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListArtifactsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListArtifactsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + ]; + client.innerApiCalls.listArtifacts = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listArtifacts( + request, + ( + err?: Error | null, + result?: protos.google.cloud.apigeeregistry.v1.IArtifact[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listArtifacts with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListArtifactsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListArtifactsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listArtifacts = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listArtifacts(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listArtifacts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listArtifactsStream without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListArtifactsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListArtifactsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + ]; + client.descriptors.page.listArtifacts.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listArtifactsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.Artifact[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.Artifact) => { + 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.listArtifacts.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listArtifacts, request) + ); + assert( + (client.descriptors.page.listArtifacts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listArtifactsStream with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListArtifactsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListArtifactsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listArtifacts.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listArtifactsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.apigeeregistry.v1.Artifact[] = []; + stream.on( + 'data', + (response: protos.google.cloud.apigeeregistry.v1.Artifact) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listArtifacts.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listArtifacts, request) + ); + assert( + (client.descriptors.page.listArtifacts.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listArtifacts without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListArtifactsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListArtifactsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.Artifact() + ), + ]; + client.descriptors.page.listArtifacts.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.apigeeregistry.v1.IArtifact[] = []; + const iterable = client.listArtifactsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listArtifacts.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listArtifacts with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.apigeeregistry.v1.ListArtifactsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.apigeeregistry.v1.ListArtifactsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listArtifacts.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listArtifactsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.apigeeregistry.v1.IArtifact[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listArtifacts.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listArtifacts.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new registryModule.v1.RegistryClient({ + 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 registryModule.v1.RegistryClient({ + 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 registryModule.v1.RegistryClient({ + 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 registryModule.v1.RegistryClient({ + 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 registryModule.v1.RegistryClient({ + 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 registryModule.v1.RegistryClient({ + 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('apiDeployment', () => { + const fakePath = '/rendered/path/apiDeployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + deployment: 'deploymentValue', + }; + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiDeploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiDeploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiDeploymentPath', () => { + const result = client.apiDeploymentPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiDeploymentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiDeploymentName', () => { + const result = client.matchProjectFromApiDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiDeploymentName', () => { + const result = client.matchLocationFromApiDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiDeploymentName', () => { + const result = client.matchApiFromApiDeploymentName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromApiDeploymentName', () => { + const result = client.matchDeploymentFromApiDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.apiDeploymentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiSpec', () => { + const fakePath = '/rendered/path/apiSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + spec: 'specValue', + }; + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiSpecPath', () => { + const result = client.apiSpecPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'specValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiSpecName', () => { + const result = client.matchProjectFromApiSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiSpecName', () => { + const result = client.matchLocationFromApiSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiSpecName', () => { + const result = client.matchApiFromApiSpecName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromApiSpecName', () => { + const result = client.matchVersionFromApiSpecName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.apiSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecFromApiSpecName', () => { + const result = client.matchSpecFromApiSpecName(fakePath); + assert.strictEqual(result, 'specValue'); + assert( + (client.pathTemplates.apiSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('apiVersion', () => { + const fakePath = '/rendered/path/apiVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + }; + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.apiVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.apiVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('apiVersionPath', () => { + const result = client.apiVersionPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.apiVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromApiVersionName', () => { + const result = client.matchProjectFromApiVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.apiVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromApiVersionName', () => { + const result = client.matchLocationFromApiVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.apiVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromApiVersionName', () => { + const result = client.matchApiFromApiVersionName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + (client.pathTemplates.apiVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromApiVersionName', () => { + const result = client.matchVersionFromApiVersionName(fakePath); + assert.strictEqual(result, 'versionValue'); + assert( + (client.pathTemplates.apiVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('instance', () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + }; + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath( + 'projectValue', + 'locationValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new registryModule.v1.RegistryClient({ + 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('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new registryModule.v1.RegistryClient({ + 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('projectLocationApiArtifact', () => { + const fakePath = '/rendered/path/projectLocationApiArtifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + artifact: 'artifactValue', + }; + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationApiArtifactPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationApiArtifactPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationApiArtifactPath', () => { + const result = client.projectLocationApiArtifactPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationApiArtifactPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationApiArtifactName', () => { + const result = + client.matchProjectFromProjectLocationApiArtifactName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationApiArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationApiArtifactName', () => { + const result = + client.matchLocationFromProjectLocationApiArtifactName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationApiArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromProjectLocationApiArtifactName', () => { + const result = + client.matchApiFromProjectLocationApiArtifactName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + ( + client.pathTemplates.projectLocationApiArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromProjectLocationApiArtifactName', () => { + const result = + client.matchArtifactFromProjectLocationApiArtifactName(fakePath); + assert.strictEqual(result, 'artifactValue'); + assert( + ( + client.pathTemplates.projectLocationApiArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationApiDeploymentArtifact', () => { + const fakePath = '/rendered/path/projectLocationApiDeploymentArtifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + deployment: 'deploymentValue', + artifact: 'artifactValue', + }; + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationApiDeploymentArtifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationApiDeploymentArtifactPath', () => { + const result = client.projectLocationApiDeploymentArtifactPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'deploymentValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationApiDeploymentArtifactName', () => { + const result = + client.matchProjectFromProjectLocationApiDeploymentArtifactName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationApiDeploymentArtifactName', () => { + const result = + client.matchLocationFromProjectLocationApiDeploymentArtifactName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromProjectLocationApiDeploymentArtifactName', () => { + const result = + client.matchApiFromProjectLocationApiDeploymentArtifactName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromProjectLocationApiDeploymentArtifactName', () => { + const result = + client.matchDeploymentFromProjectLocationApiDeploymentArtifactName( + fakePath + ); + assert.strictEqual(result, 'deploymentValue'); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromProjectLocationApiDeploymentArtifactName', () => { + const result = + client.matchArtifactFromProjectLocationApiDeploymentArtifactName( + fakePath + ); + assert.strictEqual(result, 'artifactValue'); + assert( + ( + client.pathTemplates + .projectLocationApiDeploymentArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationApiVersionArtifact', () => { + const fakePath = '/rendered/path/projectLocationApiVersionArtifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + artifact: 'artifactValue', + }; + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationApiVersionArtifactPath', () => { + const result = client.projectLocationApiVersionArtifactPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationApiVersionArtifactName', () => { + const result = + client.matchProjectFromProjectLocationApiVersionArtifactName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationApiVersionArtifactName', () => { + const result = + client.matchLocationFromProjectLocationApiVersionArtifactName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromProjectLocationApiVersionArtifactName', () => { + const result = + client.matchApiFromProjectLocationApiVersionArtifactName(fakePath); + assert.strictEqual(result, 'apiValue'); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromProjectLocationApiVersionArtifactName', () => { + const result = + client.matchVersionFromProjectLocationApiVersionArtifactName( + fakePath + ); + assert.strictEqual(result, 'versionValue'); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromProjectLocationApiVersionArtifactName', () => { + const result = + client.matchArtifactFromProjectLocationApiVersionArtifactName( + fakePath + ); + assert.strictEqual(result, 'artifactValue'); + assert( + ( + client.pathTemplates.projectLocationApiVersionArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationApiVersionSpecArtifact', () => { + const fakePath = '/rendered/path/projectLocationApiVersionSpecArtifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + api: 'apiValue', + version: 'versionValue', + spec: 'specValue', + artifact: 'artifactValue', + }; + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationApiVersionSpecArtifactPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationApiVersionSpecArtifactPath', () => { + const result = client.projectLocationApiVersionSpecArtifactPath( + 'projectValue', + 'locationValue', + 'apiValue', + 'versionValue', + 'specValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchProjectFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchLocationFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchApiFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchApiFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'apiValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVersionFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchVersionFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'versionValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchSpecFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'specValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromProjectLocationApiVersionSpecArtifactName', () => { + const result = + client.matchArtifactFromProjectLocationApiVersionSpecArtifactName( + fakePath + ); + assert.strictEqual(result, 'artifactValue'); + assert( + ( + client.pathTemplates + .projectLocationApiVersionSpecArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationArtifact', () => { + const fakePath = '/rendered/path/projectLocationArtifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + artifact: 'artifactValue', + }; + const client = new registryModule.v1.RegistryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationArtifactPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationArtifactPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationArtifactPath', () => { + const result = client.projectLocationArtifactPath( + 'projectValue', + 'locationValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationArtifactPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationArtifactName', () => { + const result = + client.matchProjectFromProjectLocationArtifactName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationArtifactName', () => { + const result = + client.matchLocationFromProjectLocationArtifactName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromProjectLocationArtifactName', () => { + const result = + client.matchArtifactFromProjectLocationArtifactName(fakePath); + assert.strictEqual(result, 'artifactValue'); + assert( + ( + client.pathTemplates.projectLocationArtifactPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-apigeeregistry/tsconfig.json b/packages/google-cloud-apigeeregistry/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-apigeeregistry/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-apigeeregistry/webpack.config.js b/packages/google-cloud-apigeeregistry/webpack.config.js new file mode 100644 index 00000000000..af9ec89d4a7 --- /dev/null +++ b/packages/google-cloud-apigeeregistry/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: 'Provisioning', + filename: './provisioning.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader', + }, + ], + }, + mode: 'production', +}; diff --git a/release-please-config.json b/release-please-config.json index b90c33b23a0..6633bf96b5e 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -1,6 +1,7 @@ { "initial-version": "0.1.0", "packages": { + "packages/google-ai-generativelanguage": {}, "packages/google-analytics-admin": {}, "packages/google-analytics-data": {}, "packages/google-api-apikeys": {}, @@ -10,9 +11,12 @@ "packages/google-appengine": {}, "packages/google-area120-tables": {}, "packages/google-cloud-accessapproval": {}, + "packages/google-cloud-advisorynotifications": {}, "packages/google-cloud-aiplatform": {}, + "packages/google-cloud-alloydb": {}, "packages/google-cloud-apigateway": {}, "packages/google-cloud-apigeeconnect": {}, + "packages/google-cloud-apigeeregistry": {}, "packages/google-cloud-asset": {}, "packages/google-cloud-assuredworkloads": {}, "packages/google-cloud-baremetalsolution": {}, @@ -34,7 +38,10 @@ "packages/google-cloud-certificatemanager": {}, "packages/google-cloud-channel": {}, "packages/google-cloud-clouddms": {}, + "packages/google-cloud-commerce-consumer-procurement": {}, "packages/google-cloud-compute": {}, + "packages/google-cloud-confidentialcomputing": {}, + "packages/google-cloud-config": {}, "packages/google-cloud-contactcenterinsights": {}, "packages/google-cloud-contentwarehouse": {}, "packages/google-cloud-datacatalog": {}, @@ -52,6 +59,7 @@ "packages/google-cloud-discoveryengine": {}, "packages/google-cloud-documentai": {}, "packages/google-cloud-domains": {}, + "packages/google-cloud-edgecontainer": {}, "packages/google-cloud-essentialcontacts": {}, "packages/google-cloud-eventarc": {}, "packages/google-cloud-eventarc-publishing": {}, @@ -66,16 +74,20 @@ "packages/google-cloud-ids": {}, "packages/google-cloud-iot": {}, "packages/google-cloud-kms": {}, + "packages/google-cloud-kms-inventory": {}, "packages/google-cloud-language": {}, "packages/google-cloud-lifesciences": {}, "packages/google-cloud-managedidentities": {}, "packages/google-cloud-mediatranslation": {}, "packages/google-cloud-memcache": {}, "packages/google-cloud-metastore": {}, + "packages/google-cloud-migrationcenter": {}, "packages/google-cloud-monitoring": {}, + "packages/google-cloud-netapp": {}, "packages/google-cloud-networkconnectivity": {}, "packages/google-cloud-networkmanagement": {}, "packages/google-cloud-networksecurity": {}, + "packages/google-cloud-networkservices": {}, "packages/google-cloud-notebooks": {}, "packages/google-cloud-optimization": {}, "packages/google-cloud-orchestration-airflow-service": {}, @@ -83,8 +95,11 @@ "packages/google-cloud-osconfig": {}, "packages/google-cloud-oslogin": {}, "packages/google-cloud-phishingprotection": {}, + "packages/google-cloud-policysimulator": {}, "packages/google-cloud-policytroubleshooter": {}, + "packages/google-cloud-policytroubleshooter-iam": {}, "packages/google-cloud-privatecatalog": {}, + "packages/google-cloud-rapidmigrationassessment": {}, "packages/google-cloud-recaptchaenterprise": {}, "packages/google-cloud-recommender": {}, "packages/google-cloud-redis": {}, @@ -100,6 +115,9 @@ "packages/google-cloud-servicedirectory": {}, "packages/google-cloud-shell": {}, "packages/google-cloud-speech": {}, + "packages/google-cloud-sql": {}, + "packages/google-cloud-storageinsights": {}, + "packages/google-cloud-support": {}, "packages/google-cloud-talent": {}, "packages/google-cloud-tasks": {}, "packages/google-cloud-texttospeech": {}, @@ -116,43 +134,26 @@ "packages/google-cloud-webrisk": {}, "packages/google-cloud-websecurityscanner": {}, "packages/google-cloud-workflows-executions": {}, + "packages/google-cloud-workstations": {}, "packages/google-container": {}, "packages/google-dataflow": {}, "packages/google-devtools-artifactregistry": {}, "packages/google-devtools-cloudbuild": {}, + "packages/google-devtools-cloudprofiler": {}, "packages/google-devtools-containeranalysis": {}, "packages/google-iam": {}, "packages/google-iam-credentials": {}, "packages/google-identity-accesscontextmanager": {}, "packages/google-maps-addressvalidation": {}, "packages/google-maps-mapsplatformdatasets": {}, + "packages/google-maps-places": {}, "packages/google-maps-routing": {}, "packages/google-monitoring-dashboard": {}, "packages/google-privacy-dlp": {}, "packages/google-storagetransfer": {}, "packages/grafeas": {}, - "packages/google-cloud-kms-inventory": {}, - "packages/google-cloud-advisorynotifications": {}, "packages/typeless-sample-bot": {}, - "packages/google-cloud-alloydb": {}, - "packages/google-cloud-workstations": {}, - "packages/google-cloud-confidentialcomputing": {}, - "packages/google-ai-generativelanguage": {}, - "packages/google-cloud-storageinsights": {}, - "packages/google-cloud-support": {}, - "packages/google-maps-places": {}, - "packages/google-cloud-rapidmigrationassessment": {}, - "packages/google-cloud-migrationcenter": {}, - "packages/google-cloud-sql": {}, - "packages/google-cloud-commerce-consumer-procurement": {}, - "packages/google-cloud-policytroubleshooter-iam": {}, - "packages/google-cloud-config": {}, - "packages/google-cloud-netapp": {}, - "packages/google-cloud-connectors": {}, - "packages/google-cloud-policysimulator": {}, - "packages/google-cloud-edgecontainer": {}, - "packages/google-devtools-cloudprofiler": {}, - "packages/google-cloud-networkservices": {} + "packages/google-cloud-connectors": {} }, "plugins": [ {